entry_point
stringlengths
1
65
original_triton_python_code
stringlengths
208
619k
optimised_triton_code
stringlengths
1.15k
275k
repo_name
stringlengths
7
115
module_name
stringlengths
1
65
synthetic
bool
1 class
uuid
int64
0
18.5k
licenses
listlengths
1
6
stars
int64
0
19.8k
sha
stringlengths
40
40
repo_link
stringlengths
72
180
ThreeLayerCNN
import torch import torch.utils.data class ThreeLayerCNN(torch.nn.Module): """ Input: 128x128 face image (eye aligned). Output: 1-D tensor with 2 elements. Used for binary classification. Parameters: Number of conv layers: 3 Number of fully connected layers: 2 """ def __init__...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.utils.data asser...
Bhaskers-Blu-Org1/Trusted-ML-Pipelines
ThreeLayerCNN
false
7,783
[ "Apache-2.0" ]
13
3805a2e72f73cef318e1992eee70aeb319b06d1a
https://github.com/Bhaskers-Blu-Org1/Trusted-ML-Pipelines/tree/3805a2e72f73cef318e1992eee70aeb319b06d1a
AdjDecoder
import torch from torch import nn import torch.utils.data class AdjDecoder(nn.Module): def __init__(self, featureSize, hiddenSize): super(AdjDecoder, self).__init__() self.decode = nn.Linear(featureSize, hiddenSize) self.second = nn.Linear(hiddenSize, hiddenSize) self.left = nn.Li...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
BigkoalaZhu/SCORES
AdjDecoder
false
7,784
[ "MIT" ]
16
8332733c375ee85c02bd34c2adce6a3213aad3c4
https://github.com/BigkoalaZhu/SCORES/tree/8332733c375ee85c02bd34c2adce6a3213aad3c4
HardSwish
import torch from torch import nn class HardSwish(nn.Module): def __init__(self, inplace=True): super(HardSwish, self).__init__() self.relu6 = nn.ReLU6(inplace=inplace) def forward(self, x): return x * self.relu6(x + 3) / 6 def get_inputs(): return [torch.rand([4, 4, 4, 4])] ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
Bo396543018/Picodet_Pytorch
HardSwish
false
7,785
[ "Apache-2.0" ]
16
276ecbf6f4f7eefbf046d1bccc25293acf28ba25
https://github.com/Bo396543018/Picodet_Pytorch/tree/276ecbf6f4f7eefbf046d1bccc25293acf28ba25
NormedLinear
import torch import torch.nn.functional as F from torch import nn class NormedLinear(nn.Linear): """Normalized Linear Layer. Args: tempeature (float, optional): Tempeature term. Default to 20. power (int, optional): Power term. Default to 1.0. eps (float, optional): The minimal value ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Bo396543018/mmdetection
NormedLinear
false
7,786
[ "Apache-2.0" ]
16
eb337336d3c239dc1d20534496f69df41ae9a300
https://github.com/Bo396543018/mmdetection/tree/eb337336d3c239dc1d20534496f69df41ae9a300
NodeClassifier
import torch from torch import nn import torch.utils.data class NodeClassifier(nn.Module): def __init__(self, featureSize, hiddenSize): super(NodeClassifier, self).__init__() self.first = nn.Linear(featureSize, hiddenSize) self.tanh = nn.Tanh() self.second = nn.Linear(hiddenSize, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
BigkoalaZhu/SCORES
NodeClassifier
false
7,787
[ "MIT" ]
16
8332733c375ee85c02bd34c2adce6a3213aad3c4
https://github.com/BigkoalaZhu/SCORES/tree/8332733c375ee85c02bd34c2adce6a3213aad3c4
CNNLayerNorm
import torch import torch.nn as nn class CNNLayerNorm(nn.Module): """Layer normalization built for cnns input""" def __init__(self, n_feats): super(CNNLayerNorm, self).__init__() self.layer_norm = nn.LayerNorm(n_feats) def forward(self, x): x = x.transpose(2, 3).contiguous() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_...
BlackyYen/Speech_Recognition-PyTorch
CNNLayerNorm
false
7,788
[ "MIT" ]
16
0a986f467c540c2be88f65064ebf5ce0f6bcf70a
https://github.com/BlackyYen/Speech_Recognition-PyTorch/tree/0a986f467c540c2be88f65064ebf5ce0f6bcf70a
SymEncoder
import torch from torch import nn import torch.utils.data class SymEncoder(nn.Module): def __init__(self, featureSize, symmetrySize, hiddenSize): super(SymEncoder, self).__init__() self.left = nn.Linear(featureSize, hiddenSize) self.right = nn.Linear(symmetrySize, hiddenSize) self...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
BigkoalaZhu/SCORES
SymEncoder
false
7,789
[ "MIT" ]
16
8332733c375ee85c02bd34c2adce6a3213aad3c4
https://github.com/BigkoalaZhu/SCORES/tree/8332733c375ee85c02bd34c2adce6a3213aad3c4
D_concat
import torch import torch.utils.data import torch.nn as nn def add_layer(seq, ix, n_inputs, n_outputs, nonlin, normalization): seq.add_module('L' + str(ix), nn.Linear(n_inputs, n_outputs)) if ix > 0 and normalization: if normalization == 'LN': seq.main.add_module('A' + str(ix), nn.LayerNor...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data import torch.nn as nn assert_size_stride = torch._C._dyn...
Bhaskers-Blu-Org1/SIC
D_concat
false
7,790
[ "Apache-2.0" ]
12
c4e45d7736da6e6faabdc56bfc1336445df99204
https://github.com/Bhaskers-Blu-Org1/SIC/tree/c4e45d7736da6e6faabdc56bfc1336445df99204
RSoftmax
import torch import torch.nn.functional as F from torch import nn class RSoftmax(nn.Module): """Radix Softmax module in ``SplitAttentionConv2d``. Args: radix (int): Radix of input. groups (int): Groups of input. """ def __init__(self, radix, groups): super().__init__() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn a...
Bo396543018/Picodet_Pytorch
RSoftmax
false
7,791
[ "Apache-2.0" ]
16
276ecbf6f4f7eefbf046d1bccc25293acf28ba25
https://github.com/Bo396543018/Picodet_Pytorch/tree/276ecbf6f4f7eefbf046d1bccc25293acf28ba25
PerceptronTanh
import torch import torch.nn as nn import torch.nn.functional as F class PerceptronTanh(nn.Module): """Implements a 1-layer perceptron with Tanh activaton.""" def __init__(self, input_dimension, hidden_dimension, output_dimension): super(PerceptronTanh, self).__init__() self._layer1 = nn.Line...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Bhaskers-Blu-Org2/PDP-Solver
PerceptronTanh
false
7,792
[ "MIT" ]
28
1fca34d81f36268288f46416fb6956e5b36df69e
https://github.com/Bhaskers-Blu-Org2/PDP-Solver/tree/1fca34d81f36268288f46416fb6956e5b36df69e
SymDecoder
import torch from torch import nn import torch.utils.data class SymDecoder(nn.Module): def __init__(self, featureSize, symmetrySize, hiddenSize): super(SymDecoder, self).__init__() self.decode = nn.Linear(featureSize, hiddenSize) self.second = nn.Linear(hiddenSize, hiddenSize) sel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
BigkoalaZhu/SCORES
SymDecoder
false
7,793
[ "MIT" ]
16
8332733c375ee85c02bd34c2adce6a3213aad3c4
https://github.com/BigkoalaZhu/SCORES/tree/8332733c375ee85c02bd34c2adce6a3213aad3c4
NormedConv2d
import torch from torch import nn class NormedConv2d(nn.Conv2d): """Normalized Conv2d Layer. Args: tempeature (float, optional): Tempeature term. Default to 20. power (int, optional): Power term. Default to 1.0. eps (float, optional): The minimal value of divisor to keep ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
Bo396543018/mmdetection
NormedConv2d
false
7,794
[ "Apache-2.0" ]
16
eb337336d3c239dc1d20534496f69df41ae9a300
https://github.com/Bo396543018/mmdetection/tree/eb337336d3c239dc1d20534496f69df41ae9a300
GAT
import torch import torch.nn.functional as F import torch.nn as nn class GraphAttentionLayer(nn.Module): """ Simple GAT layer, similar to https://arxiv.org/abs/1710.10903 """ def __init__(self, in_features, out_features, dropout, alpha, concat=True): super(GraphAttentionLayer, self).__init__(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Anou9531/GUA
GAT
false
7,795
[ "MIT" ]
20
354acceb69656e76fb4ee296c66ae42c18cd939f
https://github.com/Anou9531/GUA/tree/354acceb69656e76fb4ee296c66ae42c18cd939f
PairwiseRankingLoss
import torch import torch.nn as nn class PairwiseRankingLoss(nn.Module): """ Pairwise ranking loss """ def __init__(self, margin): super(PairwiseRankingLoss, self).__init__() self.margin = margin def forward(self, anchor1, anchor2, img_sentc, sent_imgc): cost_sent = torch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
BinWang28/EvalRank-Embedding-Evaluation
PairwiseRankingLoss
false
7,796
[ "BSD-3-Clause" ]
15
454dac5c7345f01993688f33375f637129c285e3
https://github.com/BinWang28/EvalRank-Embedding-Evaluation/tree/454dac5c7345f01993688f33375f637129c285e3
ZeroConv2d
import torch import torch.nn as nn class ZeroConv2d(nn.Module): def __init__(self, in_channel, out_channel, padding=1): super().__init__() self.in_channel = in_channel self.conv = nn.Conv2d(in_channel, out_channel, [1, 1], padding=0) self.conv.weight.data.zero_() self.conv...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import torch....
BinWang28/EvalRank-Embedding-Evaluation
ZeroConv2d
false
7,797
[ "BSD-3-Clause" ]
15
454dac5c7345f01993688f33375f637129c285e3
https://github.com/BinWang28/EvalRank-Embedding-Evaluation/tree/454dac5c7345f01993688f33375f637129c285e3
DiceLoss
import torch import torch.nn as nn import torch.optim class DiceLoss(nn.Module): def __init__(self, smooth=1.0): super(DiceLoss, self).__init__() self.smooth = smooth def _dice_coeff(self, pred, target): """ Args: pred: [N, 1] within [0, 1] target: [N,...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.guards.ass...
Bobholamovic/SimpleCV
DiceLoss
false
7,798
[ "MIT" ]
44
f4edacf088d0155725a469e227de847820bdfa53
https://github.com/Bobholamovic/SimpleCV/tree/f4edacf088d0155725a469e227de847820bdfa53
ResidualBlock
import torch import torch.nn as nn class ResidualBlock(nn.Sequential): def __init__(self, *args): super(ResidualBlock, self).__init__(*args) def forward(self, x): identity = x x = super(ResidualBlock, self).forward(x) x += identity return x def get_inputs(): ret...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride @triton.jit def triton_poi_fused_add_0(in_ptr0, out_...
Bobholamovic/ever
ResidualBlock
false
7,799
[ "Apache-2.0" ]
22
f38060674a40ed53072b9d9be99cc656a830398f
https://github.com/Bobholamovic/ever/tree/f38060674a40ed53072b9d9be99cc656a830398f
GlobalAvgPool2DBaseline
import torch import torch.nn as nn import torch.optim class GlobalAvgPool2DBaseline(nn.Module): def __init__(self): super(GlobalAvgPool2DBaseline, self).__init__() def forward(self, x): x_pool = torch.mean(x.view(x.size(0), x.size(1), x.size(2) * x.size (3)), dim=2) x_poo...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dyna...
Bobholamovic/SimpleCV
GlobalAvgPool2DBaseline
false
7,800
[ "MIT" ]
44
f4edacf088d0155725a469e227de847820bdfa53
https://github.com/Bobholamovic/SimpleCV/tree/f4edacf088d0155725a469e227de847820bdfa53
LinkClassifier
import torch import torch.nn as nn import torch.nn.functional as F class LinkClassifier(nn.Module): def __init__(self, in_features, dropout=0.2): super(LinkClassifier, self).__init__() self.input = nn.Linear(in_features, 32) self.hidden1 = nn.Linear(32, 16) self.hidden2 = nn.Linea...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BlackReap-er/Sia
LinkClassifier
false
7,801
[ "MIT" ]
13
70654d55caa3315187282c88a59cf9b6e0b7c52b
https://github.com/BlackReap-er/Sia/tree/70654d55caa3315187282c88a59cf9b6e0b7c52b
MultiHeadAttention
import math import torch import torch.nn as nn class MultiHeadAttention(nn.Module): """ Multi-head Self-attention layers, a attention score dropout layer is introduced. Args: input_tensor (torch.Tensor): the input of the multi-head self-attention layer attention_mask (torch.Tensor): the a...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BELIEVEfxy/LightSANs
MultiHeadAttention
false
7,802
[ "MIT" ]
17
94ce7e59d144dbc787153b8c486cad334790ec6e
https://github.com/BELIEVEfxy/LightSANs/tree/94ce7e59d144dbc787153b8c486cad334790ec6e
DiceWithLogitsLoss
import torch import torch.nn as nn import torch.optim class DiceWithLogitsLoss(nn.Module): def __init__(self, smooth=1.0): super(DiceWithLogitsLoss, self).__init__() self.smooth = smooth def _dice_coeff(self, pred, target): """ Args: pred: [N, 1] within [0, 1] ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn import torch.optim assert_size_stride = torch._C._dynamo.guards.ass...
Bobholamovic/SimpleCV
DiceWithLogitsLoss
false
7,803
[ "MIT" ]
44
f4edacf088d0155725a469e227de847820bdfa53
https://github.com/Bobholamovic/SimpleCV/tree/f4edacf088d0155725a469e227de847820bdfa53
SigmoidRange
import torch def sigmoid_range(x, low, high): """Sigmoid function with range `(low, high)`""" return torch.sigmoid(x) * (high - low) + low class SigmoidRange(torch.nn.Module): """Sigmoid module with range `(low, x_max)`""" def __init__(self, low, high): super(SigmoidRange, self).__init__() ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
BojarLab/glycowork
SigmoidRange
false
7,804
[ "MIT" ]
22
72d37d406ad70bb9def4a5632a6605778e295fbb
https://github.com/BojarLab/glycowork/tree/72d37d406ad70bb9def4a5632a6605778e295fbb
SCS_Cell
import random import torch import torch.nn.init from torch import nn from torch.autograd import Variable import torch.utils.data class SCS_Cell(nn.Module): def __init__(self, input_size, input_dim, hidden_dim, kernel_size, bias, p_TD): super(SCS_Cell, self).__init__() self.height, self.wi...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn.ini...
BoPang1996/Semi-Coupled-Structure-for-visual-sequental-tasks
SCS_Cell
false
7,805
[ "Apache-2.0" ]
13
c6fe7c77d08928bb30cc8683123f978b0e877394
https://github.com/BoPang1996/Semi-Coupled-Structure-for-visual-sequental-tasks/tree/c6fe7c77d08928bb30cc8683123f978b0e877394
RelativeL1
import torch import torch.utils.data from torch import nn import torch.jit class RelativeL1(nn.Module): def __init__(self): super().__init__() self.criterion = torch.nn.L1Loss() def forward(self, input, target): base = target + 0.01 return self.criterion(input / base, target ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.utils.dat...
BlueAmulet/BasicSR
RelativeL1
false
7,806
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
ScaledDotProductAttention
import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropo...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BlackNoodle/TUCORE-GCN
ScaledDotProductAttention
false
7,807
[ "MIT" ]
27
16fb37d81c5b1182a31fcf7da08a9c0013b20cd6
https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6
MultiHeadAttention
import torch import torch.nn as nn import torch.nn.functional as F class ScaledDotProductAttention(nn.Module): """ Scaled Dot-Product Attention """ def __init__(self, temperature, attn_dropout=0.1): super().__init__() self.temperature = temperature self.dropout = nn.Dropout(attn_dropo...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BlackNoodle/TUCORE-GCN
MultiHeadAttention
false
7,808
[ "MIT" ]
27
16fb37d81c5b1182a31fcf7da08a9c0013b20cd6
https://github.com/BlackNoodle/TUCORE-GCN/tree/16fb37d81c5b1182a31fcf7da08a9c0013b20cd6
Classifier
import torch import torch.distributed import torch import torch.nn as nn class Classifier(nn.Module): def __init__(self, hidden_size): super(Classifier, self).__init__() self.linear1 = nn.Linear(hidden_size, 1) self.sigmoid = nn.Sigmoid() def forward(self, x, mask_cls): h = s...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.distributed import torch import torch.nn as nn assert_size_stride =...
BoonthichaSaejia/ThaiSum
Classifier
false
7,809
[ "Apache-2.0" ]
23
fdb99eab23e60a933acf4e84836f53ddf05b7c8b
https://github.com/BoonthichaSaejia/ThaiSum/tree/fdb99eab23e60a933acf4e84836f53ddf05b7c8b
Get_gradient_nopadding
import torch import torch.utils.data from torch import nn import torch.nn.functional as F import torch.jit class Get_gradient_nopadding(nn.Module): def __init__(self): super(Get_gradient_nopadding, self).__init__() kernel_v = [[0, -1, 0], [0, 0, 0], [0, 1, 0]] kernel_h = [[0, 0, 0], [-1, ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils....
BlueAmulet/BasicSR
Get_gradient_nopadding
false
7,811
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
Quantinizer
import torch class Quantinizer(torch.nn.Module): def __init__(self, size): super(Quantinizer, self).__init__() self.size = size def forward(self, x): x = (x * self.size * 0.999).long() return torch.nn.functional.one_hot(x, num_classes=self.size).float() def get_inputs(): ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
CODEJIN/SPEECHSPLIT
Quantinizer
false
7,812
[ "MIT" ]
13
b4201ca9822b2e73f98f60c160c00db3b49a0050
https://github.com/CODEJIN/SPEECHSPLIT/tree/b4201ca9822b2e73f98f60c160c00db3b49a0050
CharbonnierLoss
import torch import torch.utils.data from torch import nn import torch.jit class CharbonnierLoss(nn.Module): """Charbonnier Loss (L1)""" def __init__(self, eps=1e-06): super(CharbonnierLoss, self).__init__() self.eps = eps def forward(self, x, y): b, c, h, w = y.size() di...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice import torch.utils.data from...
BlueAmulet/BasicSR
CharbonnierLoss
false
7,813
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
SpatialCrossMapLRN
import torch import torch.nn as nn import torch.utils.data.dataloader import torch.utils.data import torch.backends.cudnn import torch.autograd import torch.nn class SpatialCrossMapLRN(nn.Module): def __init__(self, local_size=1, alpha=1.0, beta=0.75, k=1, ACROSS_CHANNELS=True): super(SpatialCros...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as nn import torch.utils.data.dataloader import torch.utils.dat...
CASIA-IVA-Lab/DCFST
SpatialCrossMapLRN
false
7,814
[ "Apache-2.0" ]
22
ca881ba3aae1ce00e4a7a6db01d99e5f6efff68b
https://github.com/CASIA-IVA-Lab/DCFST/tree/ca881ba3aae1ce00e4a7a6db01d99e5f6efff68b
PositionwiseFeedForward
import math import torch import torch.distributed import torch import torch.nn as nn def gelu(x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) class PositionwiseFeedForward(nn.Module): """ A two-layer Feed-Forward-Network with residual layer norm. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import math import ...
BoonthichaSaejia/ThaiSum
PositionwiseFeedForward
false
7,815
[ "Apache-2.0" ]
23
fdb99eab23e60a933acf4e84836f53ddf05b7c8b
https://github.com/BoonthichaSaejia/ThaiSum/tree/fdb99eab23e60a933acf4e84836f53ddf05b7c8b
L1CosineSim
import torch import torch.utils.data from torch import nn import torch.jit class L1CosineSim(nn.Module): def __init__(self, loss_lambda=5): super(L1CosineSim, self).__init__() self.similarity = torch.nn.CosineSimilarity(dim=1, eps=1e-20) self.l1_loss = nn.L1Loss() self.loss_lambda...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
BlueAmulet/BasicSR
L1CosineSim
false
7,816
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
statm_loss
import torch import torch.nn as nn class statm_loss(nn.Module): def __init__(self, eps=2): super(statm_loss, self).__init__() self.eps = eps def forward(self, x, y): x = x.view(x.size(0), x.size(1), -1) y = y.view(y.size(0), y.size(1), -1) x_mean = x.mean(dim=2) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
COMP6248-Reproducability-Challenge/KD_SRRL
statm_loss
false
7,817
[ "MIT" ]
27
958c8f9fbeb7893f9bd866aff5b065b2bde87f23
https://github.com/COMP6248-Reproducability-Challenge/KD_SRRL/tree/958c8f9fbeb7893f9bd866aff5b065b2bde87f23
resblock
import torch import torch.nn as nn class mfm(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, type=1): super(mfm, self).__init__() self.out_channels = out_channels if type == 1: self.filter = nn.Conv2d(in_channels, 2 * out_c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
BradyFU/DVG-Face
resblock
false
7,818
[ "MIT" ]
33
16d51fe7da6e4a52d144e938afb3072eb8e4e8de
https://github.com/BradyFU/DVG-Face/tree/16d51fe7da6e4a52d144e938afb3072eb8e4e8de
group
import torch import torch.nn as nn class mfm(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, type=1): super(mfm, self).__init__() self.out_channels = out_channels if type == 1: self.filter = nn.Conv2d(in_channels, 2 * out_c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
BradyFU/DVG-Face
group
false
7,819
[ "MIT" ]
33
16d51fe7da6e4a52d144e938afb3072eb8e4e8de
https://github.com/BradyFU/DVG-Face/tree/16d51fe7da6e4a52d144e938afb3072eb8e4e8de
biLinearModel
import torch import torch.distributed import torch import torch.nn as nn class biLinearModel(nn.Module): """Currently just for a pair""" def __init__(self, hidden_size): super(biLinearModel, self).__init__() self.bilinear = nn.Bilinear(hidden_size, hidden_size, 1) def forward(self, doc_e...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.distributed import torch import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cu...
BoonthichaSaejia/ThaiSum
biLinearModel
false
7,820
[ "Apache-2.0" ]
23
fdb99eab23e60a933acf4e84836f53ddf05b7c8b
https://github.com/BoonthichaSaejia/ThaiSum/tree/fdb99eab23e60a933acf4e84836f53ddf05b7c8b
FiLM
import torch import torch.nn as nn class FiLM(nn.Module): def __init__(self, zdim, maskdim): super(FiLM, self).__init__() self.gamma = nn.Linear(zdim, maskdim) self.beta = nn.Linear(zdim, maskdim) def forward(self, x, z): gamma = self.gamma(z).unsqueeze(-1).unsqueeze(-1) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
CPJKU/audio_conditioned_unet
FiLM
false
7,821
[ "MIT" ]
20
68f20f5280079e99be260f9fe9933c0064eb2d7f
https://github.com/CPJKU/audio_conditioned_unet/tree/68f20f5280079e99be260f9fe9933c0064eb2d7f
Swish
import torch import torch.utils.data from torch import nn import torch.jit def swish_func(x, beta=1.0): """ "Swish: a Self-Gated Activation Function" Searching for Activation Functions (https://arxiv.org/abs/1710.05941) If beta=1 applies the Sigmoid Linear Unit (SiLU) function element-wise If...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data from torch import nn import torch.jit assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_...
BlueAmulet/BasicSR
Swish
false
7,822
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
ResBlock
import torch from torch import nn def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) def norm(dim): return nn.GroupNorm(min(32, dim), dim) class ResBlock(nn.Module): e...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BoyanJIANG/4D-Compositional-Representation
ResBlock
false
7,823
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
convblock
import torch import torch.nn as nn import torch.nn.functional as F class AdaptiveInstanceNorm2d(nn.Module): def __init__(self, num_features, eps=1e-05, momentum=0.1): super(AdaptiveInstanceNorm2d, self).__init__() self.num_features = num_features self.eps = eps self.momentum = mom...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
BradyFU/DVG-Face
convblock
false
7,824
[ "MIT" ]
33
16d51fe7da6e4a52d144e938afb3072eb8e4e8de
https://github.com/BradyFU/DVG-Face/tree/16d51fe7da6e4a52d144e938afb3072eb8e4e8de
SirenLayer
import torch import numpy as np import torch.nn as nn class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is_first = is_first ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
BoyuanChen/neural-state-variables
SirenLayer
false
7,825
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
ConstantODE
import torch class ConstantODE(torch.nn.Module): def __init__(self, device): super(ConstantODE, self).__init__() self.a = torch.nn.Parameter(torch.tensor(0.2)) self.b = torch.nn.Parameter(torch.tensor(3.0)) def forward(self, t, y): return self.a + (y - (self.a * t + self.b)) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda @triton.j...
BoyanJIANG/4D-Compositional-Representation
ConstantODE
false
7,826
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
LatentPredModel
import torch import torch.nn as nn class LatentPredModel(torch.nn.Module): def __init__(self, in_channels): super(LatentPredModel, self).__init__() self.layer1 = nn.Linear(in_channels, 32) self.relu1 = nn.ReLU() self.layer2 = nn.Linear(32, 64) self.relu2 = nn.ReLU() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
BoyuanChen/neural-state-variables
LatentPredModel
false
7,827
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
GatedConv2d
import torch from torch import nn from torch.nn import functional as F import torch.utils import torch.distributions class GatedConv2d(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride, padding, dilation=1): super(GatedConv2d, self).__init__() self.conv = nn.Co...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils import torch.distributions assert_size_s...
Butters-cloud/denoising-normalizing-flow
GatedConv2d
false
7,828
[ "MIT" ]
12
12d56a0d069e10a744acabf5e78fdbfba8df54ee
https://github.com/Butters-cloud/denoising-normalizing-flow/tree/12d56a0d069e10a744acabf5e78fdbfba8df54ee
GlobalAttention
import torch import torch.distributed import torch import torch.nn as nn import torch.nn.functional as F def sequence_mask(lengths, max_len=None): """ Creates a boolean mask from sequence lengths. """ batch_size = lengths.numel() max_len = max_len or lengths.max() return torch.arange(0, max_le...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BoonthichaSaejia/ThaiSum
GlobalAttention
false
7,829
[ "Apache-2.0" ]
23
fdb99eab23e60a933acf4e84836f53ddf05b7c8b
https://github.com/BoonthichaSaejia/ThaiSum/tree/fdb99eab23e60a933acf4e84836f53ddf05b7c8b
Swish
import torch import torch.nn as nn class Swish(nn.Module): def __init__(self): super().__init__() def forward(self, x): return torch.sigmoid(x) * x def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_inputs(): return [[], {}]
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
CW-Huang/sdeflow-light
Swish
false
7,830
[ "MIT" ]
35
524650bc5ad69522b3e0905672deef0650374512
https://github.com/CW-Huang/sdeflow-light/tree/524650bc5ad69522b3e0905672deef0650374512
mfm
import torch import torch.nn as nn class mfm(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, type=1): super(mfm, self).__init__() self.out_channels = out_channels if type == 1: self.filter = nn.Conv2d(in_channels, 2 * out_c...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
BradyFU/DVG-Face
mfm
false
7,831
[ "MIT" ]
33
16d51fe7da6e4a52d144e938afb3072eb8e4e8de
https://github.com/BradyFU/DVG-Face/tree/16d51fe7da6e4a52d144e938afb3072eb8e4e8de
LinearDiag
import torch import torch.nn as nn class LinearDiag(nn.Module): def __init__(self, num_features, bias=False): super(LinearDiag, self).__init__() weight = torch.FloatTensor(num_features).fill_(1) self.weight = nn.Parameter(weight, requires_grad=True) if bias: bias = tor...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
CSer-Tang-hao/FS-KTN
LinearDiag
false
7,832
[ "MIT" ]
19
8e5b1637e0f86f9d29dad7ff740a9c7a4a292a74
https://github.com/CSer-Tang-hao/FS-KTN/tree/8e5b1637e0f86f9d29dad7ff740a9c7a4a292a74
GaussianFilter
import torch import torch.utils.data from torch import nn import torch.jit class GaussianFilter(nn.Module): def __init__(self, kernel_size=13, stride=1, padding=6): super(GaussianFilter, self).__init__() mean = (kernel_size - 1) / 2.0 variance = ((kernel_size - 1) / 6.0) ** 2.0 x_...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.utils.data from torch import nn import torch.jit assert_size_stride...
BlueAmulet/BasicSR
GaussianFilter
false
7,833
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
Get_gradient
import torch import torch.utils.data from torch import nn import torch.nn.functional as F import torch.jit class Get_gradient(nn.Module): def __init__(self): super(Get_gradient, self).__init__() kernel_v = [[0, -1, 0], [0, 0, 0], [0, 1, 0]] kernel_h = [[0, 0, 0], [-1, 0, 1], [0, 0, 0]] ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.utils....
BlueAmulet/BasicSR
Get_gradient
false
7,834
[ "Apache-2.0" ]
12
7040913d8659a05af4c2428feb71c260efbf1e9c
https://github.com/BlueAmulet/BasicSR/tree/7040913d8659a05af4c2428feb71c260efbf1e9c
GAP
import torch import torch.nn as nn import torch.utils.data class GAP(nn.Module): def __init__(self, dimension=1): """ :param dimension: """ super(GAP, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) def forward(self, x): """ :param x: ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
CaptainEven/MCMOT-ByteTrack
GAP
false
7,835
[ "MIT" ]
20
e014275cfb25147dfa6f49cdbed24e91e5d6c41e
https://github.com/CaptainEven/MCMOT-ByteTrack/tree/e014275cfb25147dfa6f49cdbed24e91e5d6c41e
ODEfunc
import torch from torch import nn def norm(dim): return nn.GroupNorm(min(32, dim), dim) class ConcatConv2d(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False): super(ConcatConv2d, self).__init__() module = n...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BoyanJIANG/4D-Compositional-Representation
ODEfunc
false
7,836
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
WeightedFeatureFusion
import torch import torch.nn as nn import torch.utils.data class WeightedFeatureFusion(nn.Module): def __init__(self, layers, weight=False): """ :param layers: :param weight: """ super(WeightedFeatureFusion, self).__init__() self.layers = layers self.weight...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C....
CaptainEven/MCMOT-ByteTrack
WeightedFeatureFusion
false
7,837
[ "MIT" ]
20
e014275cfb25147dfa6f49cdbed24e91e5d6c41e
https://github.com/CaptainEven/MCMOT-ByteTrack/tree/e014275cfb25147dfa6f49cdbed24e91e5d6c41e
ResnetBlockFC
import torch from torch import nn class ResnetBlockFC(nn.Module): """ Fully connected ResNet Block class. Args: size_in (int): input dimension size_out (int): output dimension size_h (int): hidden dimension """ def __init__(self, size_in, size_out=None, size_h=None): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
BoyanJIANG/4D-Compositional-Representation
ResnetBlockFC
false
7,838
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
simple_decoder
import torch from torch import nn import torch.utils import torch.distributions class simple_decoder(nn.Module): def __init__(self, channels, width, height, dropout): super(simple_decoder, self).__init__() self.width = width self.height = height self.channels = channels se...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils import torch.distributions assert_size_s...
Butters-cloud/denoising-normalizing-flow
simple_decoder
false
7,839
[ "MIT" ]
12
12d56a0d069e10a744acabf5e78fdbfba8df54ee
https://github.com/Butters-cloud/denoising-normalizing-flow/tree/12d56a0d069e10a744acabf5e78fdbfba8df54ee
Reorg
import torch import torch.nn as nn class Reorg(nn.Module): def __init__(self, stride=2): super(Reorg, self).__init__() self.stride = stride def forward(self, x): assert x.data.dim() == 4 B = x.data.size(0) C = x.data.size(1) H = x.data.size(2) W = x.da...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
CharlesPikachu/CharlesFace
Reorg
false
7,840
[ "MIT" ]
13
90bfe38c58068228d0069dce43b55b2570acaa16
https://github.com/CharlesPikachu/CharlesFace/tree/90bfe38c58068228d0069dce43b55b2570acaa16
ContrastiveLoss
import torch from torch import nn from torch.nn import functional as F class ContrastiveLoss(nn.Module): """ Contrastive loss function. ref: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf """ def __init__(self, margin=2.0): super(ContrastiveLoss, self).__init__() se...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice from torch import nn assert_...
CV-ZMH/human-action-recognition
ContrastiveLoss
false
7,841
[ "MIT" ]
36
009bd1da71c087c3071173b325e34ed342599581
https://github.com/CV-ZMH/human-action-recognition/tree/009bd1da71c087c3071173b325e34ed342599581
Upsample
import torch import torch.nn as nn class Upsample(nn.Module): def __init__(self, stride=2): super(Upsample, self).__init__() self.stride = stride def forward(self, x): assert x.data.dim() == 4 B = x.data.size(0) C = x.data.size(1) H = x.data.size(2) W ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
CharlesPikachu/CharlesFace
Upsample
false
7,842
[ "MIT" ]
13
90bfe38c58068228d0069dce43b55b2570acaa16
https://github.com/CharlesPikachu/CharlesFace/tree/90bfe38c58068228d0069dce43b55b2570acaa16
softmax_SR
import torch import torch.nn as nn import torch.nn.functional as F class softmax_SR(nn.Module): def __init__(self): super().__init__() def forward(self, x): sr = F.softmax(x.reshape(x.size(0), x.size(1), -1), dim=2) sr = sr.transpose(1, 2) return sr def get_inputs(): re...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn ...
CILAB-MA/Machine_ToM
softmax_SR
false
7,843
[ "MIT" ]
13
8c168ee31cc95a7f57998e8907273799533fe04f
https://github.com/CILAB-MA/Machine_ToM/tree/8c168ee31cc95a7f57998e8907273799533fe04f
Attn
import torch import torch.nn.functional as F from torch import nn class Attn(nn.Module): def __init__(self, hidden_size): super().__init__() self.hidden_size = hidden_size self.attn = nn.Linear(self.hidden_size * 2, hidden_size) self.v = nn.Linear(hidden_size, 1, bias=False) ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
ChansongJo/DAMD
Attn
false
7,844
[ "Apache-2.0" ]
39
9b0456d7e590fb5de77ec81e967e8010487eeb56
https://github.com/ChansongJo/DAMD/tree/9b0456d7e590fb5de77ec81e967e8010487eeb56
InputInjection
import torch import torch.nn as nn import torch._C import torch.serialization class InputInjection(nn.Module): """Downsampling module for CGNet.""" def __init__(self, num_downsampling): super(InputInjection, self).__init__() self.pool = nn.ModuleList() for i in range(num_downsampling)...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch._C import torch.serialization assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strid...
CarnoZhao/mmsegmentation
InputInjection
false
7,845
[ "Apache-2.0" ]
18
bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
https://github.com/CarnoZhao/mmsegmentation/tree/bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
MultiHeadAttentionWithPooling
import math import torch import torch.nn as nn class kAttentionPooling(nn.Module): def __init__(self, seq_len, hidden_size, k_heads=5): super().__init__() self.k_heads = k_heads self.theta_k = nn.Parameter(torch.randn([hidden_size, k_heads])) def forward(self, input_tensor): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
BELIEVEfxy/LightSANs
MultiHeadAttentionWithPooling
false
7,846
[ "MIT" ]
17
94ce7e59d144dbc787153b8c486cad334790ec6e
https://github.com/BELIEVEfxy/LightSANs/tree/94ce7e59d144dbc787153b8c486cad334790ec6e
ExampleBackbone
import torch import torch.nn as nn import torch._C import torch.serialization class ExampleBackbone(nn.Module): def __init__(self): super(ExampleBackbone, self).__init__() self.conv = nn.Conv2d(3, 3, 3) def init_weights(self, pretrained=None): pass def forward(self, x): ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch._C import torch.serialization assert_size_str...
CarnoZhao/mmsegmentation
ExampleBackbone
false
7,847
[ "Apache-2.0" ]
18
bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
https://github.com/CarnoZhao/mmsegmentation/tree/bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
WScaleLayer
import torch import torch.nn as nn class WScaleLayer(nn.Module): def __init__(self, size): super(WScaleLayer, self).__init__() self.scale = nn.Parameter(torch.randn([1])) self.b = nn.Parameter(torch.randn(size)) self.size = size def forward(self, x): x_size = x.size()...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors
WScaleLayer
false
7,848
[ "MIT" ]
24
4198bd2d325a32ffc4e714c486540e63440ab110
https://github.com/ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors/tree/4198bd2d325a32ffc4e714c486540e63440ab110
SpatialGatherModule
import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class SpatialGatherModule(nn.Module): """Aggregate the context features according to the initial predicted probability distribution. Employ the soft-weighted method to aggregate the context. ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
CarnoZhao/mmsegmentation
SpatialGatherModule
false
7,849
[ "Apache-2.0" ]
18
bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
https://github.com/CarnoZhao/mmsegmentation/tree/bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
SineODE
import math import torch class SineODE(torch.nn.Module): def __init__(self, device): super(SineODE, self).__init__() def forward(self, t, y): return 2 * y / t + t ** 4 * torch.sin(2 * t) - t ** 2 + 4 * t ** 3 def y_exact(self, t): return -0.5 * t ** 4 * torch.cos(2 * t) + 0.5 * ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import math assert_size_stride = torch._C._dynamo.guards.assert_size_stri...
BoyanJIANG/4D-Compositional-Representation
SineODE
false
7,850
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
PPMConcat
import torch import torch.nn as nn import torch._C import torch.serialization class PPMConcat(nn.ModuleList): """Pyramid Pooling Module that only concat the features of each layer. Args: pool_scales (tuple[int]): Pooling scales used in Pooling Pyramid Module. """ def __init__(sel...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn import torch._C import torch.serialization assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strid...
CarnoZhao/mmsegmentation
PPMConcat
false
7,851
[ "Apache-2.0" ]
18
bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
https://github.com/CarnoZhao/mmsegmentation/tree/bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
JaccardLoss
import torch from torch.nn import functional as F from torch.nn.modules.loss import _Loss class JaccardLoss(_Loss): def __init__(self): super(JaccardLoss, self).__init__() def forward(self, output, target): output = F.sigmoid(output) intersection = torch.sum(output * target) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn.modules.loss import _Loss assert_size_stride = torch._C._dynamo.guards.asse...
BloodAxe/segmentation-networks-benchmark
JaccardLoss
false
7,852
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
AsymmetricLossMultiLabel
import torch import torch.nn as nn import torch.multiprocessing import torch.utils.data import torch.nn.parallel from torch import optim as optim class AsymmetricLossMultiLabel(nn.Module): def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-08, disable_torch_grad_focal_loss=False): sup...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ChenMnZ/CF-ViT
AsymmetricLossMultiLabel
false
7,853
[ "Apache-2.0" ]
18
afc7ba54510cfbd410921a8b5eb5d6f0243718e7
https://github.com/ChenMnZ/CF-ViT/tree/afc7ba54510cfbd410921a8b5eb5d6f0243718e7
RefineModelReLU
import torch import torch.nn as nn class RefineModelReLU(torch.nn.Module): def __init__(self, in_channels): super(RefineModelReLU, self).__init__() self.layer1 = nn.Linear(in_channels, 128) self.relu1 = nn.ReLU() self.layer2 = nn.Linear(128, 64) self.relu2 = nn.ReLU() ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_...
BoyuanChen/neural-state-variables
RefineModelReLU
false
7,854
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
Block
import torch import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization class LayerNorm(nn.Module): """ LayerNorm that supports two data formats: channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
CarnoZhao/mmsegmentation
Block
false
7,855
[ "Apache-2.0" ]
18
bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
https://github.com/CarnoZhao/mmsegmentation/tree/bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
ConvRelu
import torch from torch import nn def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True) class ConvRelu(nn.Module): def __init__(self, in_: 'int', out: 'int'): super().__init__() self.conv = conv3x3(i...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
BloodAxe/segmentation-networks-benchmark
ConvRelu
false
7,856
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
ConvBlock
import torch import torch.nn as nn import torch.nn.functional as F class ConvBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel, stride, padding=0): super(ConvBlock, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=kernel, stride=stride...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
CPJKU/audio_conditioned_unet
ConvBlock
false
7,857
[ "MIT" ]
20
68f20f5280079e99be260f9fe9933c0064eb2d7f
https://github.com/CPJKU/audio_conditioned_unet/tree/68f20f5280079e99be260f9fe9933c0064eb2d7f
JaccardScore
import torch from torch.nn import functional as F from torch.nn.modules.loss import _Loss class JaccardScore(_Loss): def __init__(self): super(JaccardScore, self).__init__() def forward(self, output, target): output = F.sigmoid(output) target = target.float() intersection = (...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn.modules.loss import _Loss assert_size_stride = torch._C._dynamo.guards.asse...
BloodAxe/segmentation-networks-benchmark
JaccardScore
false
7,858
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
RefineFireModel
import torch import numpy as np import torch.nn as nn class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is_first = is_first ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
BoyuanChen/neural-state-variables
RefineFireModel
false
7,859
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
DiceLoss
import functools import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torch._C import torch.serialization def reduce_loss(loss, reduction): """Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math import functools impor...
CarnoZhao/mmsegmentation
DiceLoss
false
7,860
[ "Apache-2.0" ]
18
bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
https://github.com/CarnoZhao/mmsegmentation/tree/bdaf3d93c4d33c3f0c15f95879fdd7ab78290c1c
RefineElasticPendulumModel
import torch import numpy as np import torch.nn as nn class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is_first = is_first ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
BoyuanChen/neural-state-variables
RefineElasticPendulumModel
false
7,861
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
outconv
import torch from torch import nn class outconv(nn.Module): def __init__(self, in_ch, out_ch): super(outconv, self).__init__() self.conv = nn.Conv2d(in_ch, out_ch, 1) def forward(self, x): x = self.conv(x) return x def get_inputs(): return [torch.rand([4, 4, 4, 4])] d...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
BloodAxe/segmentation-networks-benchmark
outconv
false
7,862
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
Copy
import torch from torch import nn class Copy(nn.Module): def __init__(self, hidden_size, copy_weight=1.0): super().__init__() self.Wcopy = nn.Linear(hidden_size, hidden_size) self.copy_weight = copy_weight def forward(self, enc_out_hs, dec_hs): """ get unnormalized co...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
ChansongJo/DAMD
Copy
false
7,863
[ "Apache-2.0" ]
39
9b0456d7e590fb5de77ec81e967e8010487eeb56
https://github.com/ChansongJo/DAMD/tree/9b0456d7e590fb5de77ec81e967e8010487eeb56
ConvEncoder3D
import torch from torch import nn class ConvEncoder3D(nn.Module): """ Simple convolutional conditioning network. It consists of 6 convolutional layers, each downsampling the input by a factor of 2, and a final fully-connected layer projecting the output to c_dim dimensions. """ def __init__(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
BoyanJIANG/4D-Compositional-Representation
ConvEncoder3D
false
7,864
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
RefineCircularMotionModel
import torch import numpy as np import torch.nn as nn class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is_first = is_first ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
BoyuanChen/neural-state-variables
RefineCircularMotionModel
false
7,865
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
RefineLavaLampModel
import torch import numpy as np import torch.nn as nn class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is_first = is_first ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
BoyuanChen/neural-state-variables
RefineLavaLampModel
false
7,866
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
ConcatConv2d
import torch from torch import nn class ConcatConv2d(nn.Module): def __init__(self, dim_in, dim_out, ksize=3, stride=1, padding=0, dilation=1, groups=1, bias=True, transpose=False): super(ConcatConv2d, self).__init__() module = nn.ConvTranspose2d if transpose else nn.Conv2d self._...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
BoyanJIANG/4D-Compositional-Representation
ConcatConv2d
false
7,867
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
Decoder
import torch from torch import nn class Decoder(nn.Module): def __init__(self, latent_dim=4, obs_dim=2, nhidden=20): super(Decoder, self).__init__() self.relu = nn.ReLU(inplace=True) self.fc1 = nn.Linear(latent_dim, nhidden) self.fc2 = nn.Linear(nhidden, obs_dim) def forward(...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
BoyanJIANG/4D-Compositional-Representation
Decoder
false
7,868
[ "Apache-2.0" ]
12
64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
https://github.com/BoyanJIANG/4D-Compositional-Representation/tree/64d5f4bbd6b8e6bc3bfd8f76736f6d468c71a73c
FeatExemplarAvgBlock
import torch import torch.nn as nn class FeatExemplarAvgBlock(nn.Module): def __init__(self, nFeat): super(FeatExemplarAvgBlock, self).__init__() def forward(self, features_train, labels_train): labels_train_transposed = labels_train.transpose(1, 2) weight_novel = torch.bmm(labels_tr...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
CSer-Tang-hao/FS-KTN
FeatExemplarAvgBlock
false
7,869
[ "MIT" ]
19
8e5b1637e0f86f9d29dad7ff740a9c7a4a292a74
https://github.com/CSer-Tang-hao/FS-KTN/tree/8e5b1637e0f86f9d29dad7ff740a9c7a4a292a74
SmoothJaccardLoss
import torch from torch.nn import functional as F from torch.nn.modules.loss import _Loss class SmoothJaccardLoss(_Loss): def __init__(self, smooth=100): super(SmoothJaccardLoss, self).__init__() self.smooth = smooth def forward(self, output, target): output = F.sigmoid(output) ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch.nn.modules.loss import _Loss assert_size_stride = torch._C._dynamo.guards.asse...
BloodAxe/segmentation-networks-benchmark
SmoothJaccardLoss
false
7,870
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
RefineDoublePendulumModel
import torch import numpy as np import torch.nn as nn class SirenLayer(nn.Module): def __init__(self, in_f, out_f, w0=30, is_first=False, is_last=False): super().__init__() self.in_f = in_f self.w0 = w0 self.linear = nn.Linear(in_f, out_f) self.is_first = is_first ...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import math as tl_math import numpy ...
BoyuanChen/neural-state-variables
RefineDoublePendulumModel
false
7,871
[ "MIT" ]
17
10483d93ac8c006f3786c434fb57d70d9ab465ec
https://github.com/BoyuanChen/neural-state-variables/tree/10483d93ac8c006f3786c434fb57d70d9ab465ec
DiceLoss
import torch from torch import nn from torch.nn import functional as F class DiceLoss(nn.Module): def __init__(self): super(DiceLoss, self).__init__() def forward(self, output, target): prediction = F.sigmoid(output) intersection = torch.sum(prediction * target) union = torch...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
BloodAxe/segmentation-networks-benchmark
DiceLoss
false
7,872
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
GraphConv
import torch import torch.nn as nn from torch.nn.init import xavier_uniform_ class GraphConv(nn.Module): def __init__(self, in_channels, out_channels, dropout=False, relu=True): super(GraphConv, self).__init__() if dropout: self.dropout = nn.Dropout(p=0.5) else: se...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.nn as nn from torch.nn.init import xavier_uniform_ assert_size_stri...
CSer-Tang-hao/FS-KTN
GraphConv
false
7,873
[ "MIT" ]
19
8e5b1637e0f86f9d29dad7ff740a9c7a4a292a74
https://github.com/CSer-Tang-hao/FS-KTN/tree/8e5b1637e0f86f9d29dad7ff740a9c7a4a292a74
TransitionUp
import torch from torch import nn def center_crop(layer, max_height, max_width): _, _, h, w = layer.size() xy1 = (w - max_width) // 2 xy2 = (h - max_height) // 2 return layer[:, :, xy2:xy2 + max_height, xy1:xy1 + max_width] class TransitionUp(nn.Module): def __init__(self, in_channels, out_chan...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
BloodAxe/segmentation-networks-benchmark
TransitionUp
false
7,874
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
GenNoise
import torch import torch.optim import torch.nn as nn import torch.nn.init class GenNoise(nn.Module): def __init__(self, dim2): super(GenNoise, self).__init__() self.dim2 = dim2 def forward(self, input): a = list(input.size()) a[1] = self.dim2 b = torch.zeros(a).type_...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.optim import torch.nn as nn import torch.nn.init assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_...
ChongYou/robust-image-recovery
GenNoise
false
7,875
[ "MIT" ]
13
5bb23142509f307d31fd435de12787a70ec3a5bc
https://github.com/ChongYou/robust-image-recovery/tree/5bb23142509f307d31fd435de12787a70ec3a5bc
_BoundaryRefineModule
import torch from torch import nn class _BoundaryRefineModule(nn.Module): def __init__(self, dim): super(_BoundaryRefineModule, self).__init__() self.relu = nn.ReLU(inplace=True) self.conv1 = nn.Conv2d(dim, dim, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(dim, dim, kernel_siz...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch import nn assert_s...
BloodAxe/segmentation-networks-benchmark
_BoundaryRefineModule
false
7,876
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
_GlobalConvModule
import torch from torch import nn class _GlobalConvModule(nn.Module): def __init__(self, in_dim, out_dim, kernel_size): super(_GlobalConvModule, self).__init__() pad0 = (kernel_size[0] - 1) // 2 pad1 = (kernel_size[1] - 1) // 2 super(_GlobalConvModule, self).__init__() sel...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
BloodAxe/segmentation-networks-benchmark
_GlobalConvModule
false
7,877
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
NormUpscaleConvBlock
import torch import torch.nn as nn import torch.nn.functional as F class PixelNormLayer(nn.Module): def __init__(self): super(PixelNormLayer, self).__init__() def forward(self, x): return x / torch.sqrt(torch.mean(x ** 2, dim=1, keepdim=True) + 1e-08) class WScaleLayer(nn.Module): def...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors
NormUpscaleConvBlock
false
7,878
[ "MIT" ]
24
4198bd2d325a32ffc4e714c486540e63440ab110
https://github.com/ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors/tree/4198bd2d325a32ffc4e714c486540e63440ab110
DFire
import torch from torch import nn class DFire(nn.Module): def __init__(self, inplanes, squeeze_planes, expand1x1_planes, expand3x3_planes): super(DFire, self).__init__() self.inplanes = inplanes self.expand1x1 = nn.Conv2d(inplanes, expand1x1_planes, kernel_size=1) self.exp...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice from torch import n...
BloodAxe/segmentation-networks-benchmark
DFire
false
7,879
[ "MIT" ]
34
2e3feb560102230be9369ab442b4a59cc86dff61
https://github.com/BloodAxe/segmentation-networks-benchmark/tree/2e3feb560102230be9369ab442b4a59cc86dff61
ZeroPad1d
import torch import torch.nn.functional as F from torch import nn import torch.utils.data import torch.onnx.operators import torch.optim import torch.optim.lr_scheduler class ZeroPad1d(nn.Module): def __init__(self, pad_left, pad_right): super().__init__() self.pad_left = pad_left self.pa...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch import nn import torch.utils.data import torch.onnx.operators import torch.optim import torch.optim.lr_scheduler assert_size_stri...
ChenDdon/AGBTcode
ZeroPad1d
false
7,880
[ "MIT" ]
21
6c259d18b48dc8d6da1357c42a1ee088666fb7b4
https://github.com/ChenDdon/AGBTcode/tree/6c259d18b48dc8d6da1357c42a1ee088666fb7b4
ResidualSequential
import torch import torch.optim import torch.nn as nn import torch.nn.init class ResidualSequential(nn.Sequential): def __init__(self, *args): super(ResidualSequential, self).__init__(*args) def forward(self, x): out = super(ResidualSequential, self).forward(x) x_ = None if o...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream import torch.optim import torch.nn as nn import torch.nn.init assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_...
ChongYou/robust-image-recovery
ResidualSequential
false
7,881
[ "MIT" ]
13
5bb23142509f307d31fd435de12787a70ec3a5bc
https://github.com/ChongYou/robust-image-recovery/tree/5bb23142509f307d31fd435de12787a70ec3a5bc
NormConvBlock
import torch import torch.nn as nn import torch.nn.functional as F class PixelNormLayer(nn.Module): def __init__(self): super(PixelNormLayer, self).__init__() def forward(self, x): return x / torch.sqrt(torch.mean(x ** 2, dim=1, keepdim=True) + 1e-08) class WScaleLayer(nn.Module): def...
import torch from torch._inductor.select_algorithm import extern_kernels import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime.triton_helpers import libdevice import torch.nn as ...
ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors
NormConvBlock
false
7,882
[ "MIT" ]
24
4198bd2d325a32ffc4e714c486540e63440ab110
https://github.com/ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors/tree/4198bd2d325a32ffc4e714c486540e63440ab110
RegularizationLoss
import torch import torch.nn as nn class RegularizationLoss(nn.Module): def __init__(self, lambda_p: 'float', max_layers: 'int'): super().__init__() p_g = torch.zeros((max_layers,)) not_halted = 1.0 for k in range(max_layers): p_g[k] = lambda_p * not_halted ...
import torch import triton import triton.language as tl from torch._inductor.runtime.triton_heuristics import grid from torch._C import _cuda_getCurrentRawStream as get_raw_stream from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math import torc...
ChenghaoMou/embeddings
RegularizationLoss
false
7,883
[ "MIT" ]
12
e63c2f2f4a688302de37bb8ccfd37a0170e2c374
https://github.com/ChenghaoMou/embeddings/tree/e63c2f2f4a688302de37bb8ccfd37a0170e2c374