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
LSTMAttentionLayer
import torch import torch.nn as nn import torch.utils import torch.nn.functional as F import torch.optim import torch.utils.data import torch.onnx.operators def Linear(in_features, out_features, bias=True): m = nn.Linear(in_features, out_features, bias) nn.init.xavier_uniform_(m.weight) if bias: 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....
PeterouZh/SemiNAS
LSTMAttentionLayer
false
17,821
[ "Apache-2.0" ]
5
39731663271b994571160d43d796b2bb93386b3b
https://github.com/PeterouZh/SemiNAS/tree/39731663271b994571160d43d796b2bb93386b3b
Mean
from torch.nn import Module import torch import torch.utils.data class Mean(Module): def __init__(self, dim, keep_dim=False): super(Mean, self).__init__() self.dim = dim self.keep_dim = keep_dim def forward(self, input): return input.mean(self.dim, self.keep_dim) def get_in...
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.nn import Module import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = tor...
RL-WWW/ISST
Mean
false
17,822
[ "BSD-3-Clause" ]
5
42b656686fa9660794007a0bc00a7177937410e9
https://github.com/RL-WWW/ISST/tree/42b656686fa9660794007a0bc00a7177937410e9
GumbelQuantize
import torch import torch.nn as nn import torch.nn.functional as F from torch import einsum class GumbelQuantize(nn.Module): """ Reference: Categorical Reparameterization with Gumbel-Softmax, Jang et al. 2016 https://arxiv.org/abs/1611.01144 """ def __init__(self, hidden_channel, n_e, e_dim, ...
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....
PeikeLi/pytorch-vector-quantization
GumbelQuantize
false
17,823
[ "MIT" ]
6
48ce6a74ec56b9d8c11dde2cd35b055a925c3070
https://github.com/PeikeLi/pytorch-vector-quantization/tree/48ce6a74ec56b9d8c11dde2cd35b055a925c3070
GeneratorLon
import torch import torch.onnx import torch.nn as nn import torch.nn.functional as F class GeneratorLon(nn.Module): """Define standard linear + softmax generation step.""" def __init__(self, d_model, tgt_lon_classes): super(GeneratorLon, self).__init__() self.proj = nn.Linear(d_model, 2, tgt_...
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....
PhilippeW83440/conv-social-pooling
GeneratorLon
false
17,824
[ "MIT" ]
4
93d3a08af8678c3309d75a9bfb37df500da5cc46
https://github.com/PhilippeW83440/conv-social-pooling/tree/93d3a08af8678c3309d75a9bfb37df500da5cc46
C3D
import torch import torch.nn as nn import torch.nn.parallel import torch.optim from torch.nn.init import * class C3D(nn.Module): """ The C3D network. """ def __init__(self, num_classes, pretrained=False, path=None): super(C3D, self).__init__() self.conv1 = nn.Conv3d(3, 64, kernel_size...
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 import ...
Luoyadan/MM2020_ABG
C3D
false
17,825
[ "MIT" ]
8
d74cf915deea7bb425518f5bd40e64a9a7341981
https://github.com/Luoyadan/MM2020_ABG/tree/d74cf915deea7bb425518f5bd40e64a9a7341981
GluMlp
import torch import torch.nn as nn class GluMlp(nn.Module): """ MLP w/ GLU style gating See: https://arxiv.org/abs/1612.08083, https://arxiv.org/abs/2002.05202 """ def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.Sigmoid, drop=0.0): super().__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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
RICE-EIC/Patch-Fool
GluMlp
false
17,826
[ "MIT" ]
7
9638ec33a4d13b0c5ff0ec3ee5ce6b46ea7da5a6
https://github.com/RICE-EIC/Patch-Fool/tree/9638ec33a4d13b0c5ff0ec3ee5ce6b46ea7da5a6
AffinityLoss
import torch from torch import Tensor import torch.nn as nn class AffinityLoss(nn.Module): """ GNINA affinity loss. Parameters ---------- reduction: str Reduction method (mean or sum) delta: float Scaling factor penalty: float Penalty factor pseudo_huber: bool ...
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...
RMeli/gnina-torch
AffinityLoss
false
17,827
[ "MIT" ]
5
eb57e2a62628d39f2a66e7fa1748e80705366761
https://github.com/RMeli/gnina-torch/tree/eb57e2a62628d39f2a66e7fa1748e80705366761
FingerprintDecoder
import torch import torch.utils.data import torch.nn.functional as F class FingerprintDecoder(torch.nn.Module): def __init__(self, n_in, n_out, dropout=0.1): super(FingerprintDecoder, self).__init__() if n_out > n_in: n_hidden = n_out // 2 else: n_hidden = n_in // ...
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...
Prepaire/MolGNN_fewshot
FingerprintDecoder
false
17,828
[ "MIT" ]
6
c7c17afdeae7f2ef0c8e3ca2da033091ec7537ca
https://github.com/Prepaire/MolGNN_fewshot/tree/c7c17afdeae7f2ef0c8e3ca2da033091ec7537ca
CustomGruCell
import torch import numpy as np import torch.nn as nn class CustomGruCell(nn.Module): """ A forward only GRU cell. Input should be: (sequence length x batch size x input_size). The output is the output of the final forward call. It's not clear if it would be possible to use the output from each ce...
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 numpy as np ...
Rahul-160/PySyft
CustomGruCell
false
17,829
[ "Apache-2.0" ]
7
182627db2369d6f93aa0667f5ea2abee5b878d58
https://github.com/Rahul-160/PySyft/tree/182627db2369d6f93aa0667f5ea2abee5b878d58
GeneratorLat
import torch import torch.onnx import torch.nn as nn import torch.nn.functional as F class GeneratorLat(nn.Module): """Define standard linear + softmax generation step.""" def __init__(self, d_model, tgt_lat_classes): super(GeneratorLat, self).__init__() self.proj = nn.Linear(d_model, tgt_lat...
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....
PhilippeW83440/conv-social-pooling
GeneratorLat
false
17,830
[ "MIT" ]
4
93d3a08af8678c3309d75a9bfb37df500da5cc46
https://github.com/PhilippeW83440/conv-social-pooling/tree/93d3a08af8678c3309d75a9bfb37df500da5cc46
Actor
import torch import torch.nn as nn import torch.nn.functional as F class Actor(nn.Module): def __init__(self, input_dim, output_dim): super(Actor, self).__init__() self.fc1 = nn.Linear(input_dim, 128) self.fc2 = nn.Linear(128, output_dim) def forward(self, x): x = F.relu(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 import triton_helpers from torch._inductor.runtime....
PaulPan00/donkey_wrapper
Actor
false
17,831
[ "MIT" ]
6
a03cf0f42f65625fbce792b06c98acd153c5d6c8
https://github.com/PaulPan00/donkey_wrapper/tree/a03cf0f42f65625fbce792b06c98acd153c5d6c8
RevPaddingLayer
import torch import torch.nn as nn class RevPaddingLayer(nn.Module): def __init__(self, stride): super().__init__() self.pool = nn.AvgPool2d(kernel_size=3, stride=stride, padding=1) def forward(self, x): x = self.pool(x) zeros = torch.zeros_like(x) zeros_left, zeros_r...
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...
RKorzeniowski/BigBiGAN-PyTorch
RevPaddingLayer
false
17,832
[ "MIT" ]
5
caaaf69b094ae45e9fa3608577fde32dafa1f16e
https://github.com/RKorzeniowski/BigBiGAN-PyTorch/tree/caaaf69b094ae45e9fa3608577fde32dafa1f16e
AvgPool2d
from torch.nn import Module import torch import torch as th class AvgPool2d(Module): """ This class is the beginning of an exact python port of the torch.nn.AvgPool2d module. Because PySyft cannot hook into layers which are implemented in C++, our special functionalities (such as encrypted computation...
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.nn import Module assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._em...
Rahul-160/PySyft
AvgPool2d
false
17,833
[ "Apache-2.0" ]
7
182627db2369d6f93aa0667f5ea2abee5b878d58
https://github.com/Rahul-160/PySyft/tree/182627db2369d6f93aa0667f5ea2abee5b878d58
myEncoder
import torch import torch.nn.functional as F class myEncoder(torch.nn.Module): def __init__(self, fomSize, romSize): super(myEncoder, self).__init__() self.fc1 = torch.nn.Linear(fomSize, 200) self.fc2 = torch.nn.Linear(200, 64) self.fc3 = torch.nn.Linear(64, romSize) def forw...
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 assert_size_stride ...
Pressio/pressio4py
myEncoder
false
17,834
[ "Unlicense", "BSD-3-Clause" ]
4
36676dbd112a7c7960ccbf302ff14d4376c819ec
https://github.com/Pressio/pressio4py/tree/36676dbd112a7c7960ccbf302ff14d4376c819ec
Foo
import torch import torch.nn.functional import torch.nn.parallel import torch.utils.data import torch.optim import torch.utils.data.distributed class Foo(torch.nn.Module): def __init__(self, size): super(Foo, self).__init__() self.n = torch.nn.Parameter(torch.ones(size)) self.m = torch.nn...
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.functional import torch.nn.parallel import torch.utils.data import torch.optim import torch.utils.data.distributed assert_si...
ROCmSoftwarePlatform/apex
Foo
false
17,835
[ "BSD-3-Clause" ]
6
db92ee13ca55e284342bdca84bddc38c3812f1ed
https://github.com/ROCmSoftwarePlatform/apex/tree/db92ee13ca55e284342bdca84bddc38c3812f1ed
FermiDiracDecoder
from torch.nn import Module import torch from torch.nn.modules.module import Module import torch.optim import torch.nn.modules.loss class FermiDiracDecoder(Module): """Fermi Dirac to compute edge probabilities based on distances.""" def __init__(self, r, t): super(FermiDiracDecoder, 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 from torch._inductor.runtime.triton_helpers import math as tl_math from torch.nn import Module from torch.nn.modules.module import Module im...
RingBDStack/ACE-HGNN
FermiDiracDecoder
false
17,836
[ "MIT" ]
5
afc610dd838951dcd6c3910795b472566f0c23ca
https://github.com/RingBDStack/ACE-HGNN/tree/afc610dd838951dcd6c3910795b472566f0c23ca
Fusion2_GateLayer
import torch from torch import nn class Fusion2_GateLayer(nn.Module): def __init__(self, input_dim): super(Fusion2_GateLayer, self).__init__() self._norm_layer1 = nn.Linear(input_dim * 2, input_dim) self._norm_layer2 = nn.Linear(input_dim, 1) def forward(self, input1, input2): ...
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...
RUCAIBox/WSDM2022-C2CRS
Fusion2_GateLayer
false
17,837
[ "MIT" ]
4
8ef2fa7c44bdba1799ab79f379ae7394bd468c02
https://github.com/RUCAIBox/WSDM2022-C2CRS/tree/8ef2fa7c44bdba1799ab79f379ae7394bd468c02
CrossEntropyLoss
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.optim import torch.utils.data def _is_long(x): return isinstance(x, torch.LongTensor) or isinstance(x, torch.LongTensor) def onehot(indexes, N=None, ignore_index=None): """ Creates a one-representati...
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 ...
Randl/Ranger_Mish_reimplementation
CrossEntropyLoss
false
17,838
[ "MIT" ]
7
36f580ce8a02fae1929e101c9bd6987ccd2a5843
https://github.com/Randl/Ranger_Mish_reimplementation/tree/36f580ce8a02fae1929e101c9bd6987ccd2a5843
BasicBlock
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=0, bias=True) class BasicBlock(nn.Module): """ Residual BasicBlock...
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....
RaoUmer/ISRResCNet
BasicBlock
false
17,839
[ "MIT" ]
6
8175bb9efa5bba2cce4ad86616219209c20b7244
https://github.com/RaoUmer/ISRResCNet/tree/8175bb9efa5bba2cce4ad86616219209c20b7244
HiResPose
import torch import torch.nn as nn from collections import OrderedDict from typing import Tuple import torch.nn.functional as F class HiResPose(nn.Module): """ GNINA HiResPose model architecture. Parameters ---------- input_dims: tuple Model input dimensions (channels, depth, height, widt...
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....
RMeli/gnina-torch
HiResPose
false
17,840
[ "MIT" ]
5
eb57e2a62628d39f2a66e7fa1748e80705366761
https://github.com/RMeli/gnina-torch/tree/eb57e2a62628d39f2a66e7fa1748e80705366761
GraphAttentionLayer
import torch import torch.nn as nn from torch.nn.parameter import Parameter import torch.nn.functional as F class GraphAttentionLayer(nn.Module): """ Simple GAT layer, similar to https://arxiv.org/abs/1710.10903 """ def __init__(self, in_features, out_features, dropout, alpha): super(GraphAtt...
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....
RidongHan/GHE-LPC
GraphAttentionLayer
false
17,841
[ "MIT" ]
4
2a10f423d747aa28560a3bcbf29f7ec87422beb8
https://github.com/RidongHan/GHE-LPC/tree/2a10f423d747aa28560a3bcbf29f7ec87422beb8
Fusion2_MinusFCLayer
import torch from torch import nn class Fusion2_MinusFCLayer(nn.Module): def __init__(self, input_dim): super(Fusion2_MinusFCLayer, self).__init__() self._norm_layer1 = nn.Linear(input_dim * 3, input_dim) def forward(self, input1, input2): norm_input = self._norm_layer1(torch.cat([in...
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...
RUCAIBox/WSDM2022-C2CRS
Fusion2_MinusFCLayer
false
17,842
[ "MIT" ]
4
8ef2fa7c44bdba1799ab79f379ae7394bd468c02
https://github.com/RUCAIBox/WSDM2022-C2CRS/tree/8ef2fa7c44bdba1799ab79f379ae7394bd468c02
BertLinear
import math import torch import torch.nn as nn def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3)))) ...
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 ...
Receiling/ENPAR
BertLinear
false
17,843
[ "MIT" ]
5
decd2945d21a7be5a0f73c37cfc5e252301aab15
https://github.com/Receiling/ENPAR/tree/decd2945d21a7be5a0f73c37cfc5e252301aab15
Fusion2_FCLayer
import torch from torch import nn class Fusion2_FCLayer(nn.Module): def __init__(self, input_dim): super(Fusion2_FCLayer, self).__init__() self._norm_layer1 = nn.Linear(input_dim * 2, input_dim) def forward(self, input1, input2): norm_input = self._norm_layer1(torch.cat([input1, inpu...
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...
RUCAIBox/WSDM2022-C2CRS
Fusion2_FCLayer
false
17,844
[ "MIT" ]
4
8ef2fa7c44bdba1799ab79f379ae7394bd468c02
https://github.com/RUCAIBox/WSDM2022-C2CRS/tree/8ef2fa7c44bdba1799ab79f379ae7394bd468c02
Fusion3_FCLayer
import torch from torch import nn class Fusion3_FCLayer(nn.Module): def __init__(self, input_dim): super(Fusion3_FCLayer, self).__init__() self._norm_layer1 = nn.Linear(input_dim * 3, input_dim) def forward(self, input1, input2, input3): norm_input = self._norm_layer1(torch.cat([inpu...
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...
RUCAIBox/WSDM2022-C2CRS
Fusion3_FCLayer
false
17,845
[ "MIT" ]
4
8ef2fa7c44bdba1799ab79f379ae7394bd468c02
https://github.com/RUCAIBox/WSDM2022-C2CRS/tree/8ef2fa7c44bdba1799ab79f379ae7394bd468c02
DenseAtt
import torch import torch.nn as nn import torch.optim import torch.nn.modules.loss class DenseAtt(nn.Module): def __init__(self, in_features, dropout): super(DenseAtt, self).__init__() self.dropout = dropout self.linear = nn.Linear(2 * in_features, 1, bias=True) self.in_features =...
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.optim import torch.nn.modules.loss assert_siz...
RingBDStack/ACE-HGNN
DenseAtt
false
17,846
[ "MIT" ]
5
afc610dd838951dcd6c3910795b472566f0c23ca
https://github.com/RingBDStack/ACE-HGNN/tree/afc610dd838951dcd6c3910795b472566f0c23ca
SelfAttentionBatch
import torch from torch import nn import torch.nn.functional as F class SelfAttentionBatch(nn.Module): def __init__(self, dim, da, alpha=0.2, dropout=0.5): super(SelfAttentionBatch, self).__init__() self.dim = dim self.da = da self.alpha = alpha self.dropout = dropout ...
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....
RUCAIBox/WSDM2022-C2CRS
SelfAttentionBatch
false
17,847
[ "MIT" ]
4
8ef2fa7c44bdba1799ab79f379ae7394bd468c02
https://github.com/RUCAIBox/WSDM2022-C2CRS/tree/8ef2fa7c44bdba1799ab79f379ae7394bd468c02
SelfAttentionPooling
import torch import torch.nn as nn class SelfAttentionPooling(nn.Module): """ Implementation of SelfAttentionPooling Original Paper: Self-Attention Encoding and Pooling for Speaker Recognition https://arxiv.org/pdf/2008.01077v1.pdf """ def __init__(self, input_dim): super(SelfAttentio...
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....
RayTzeng/s3m-membership-inference
SelfAttentionPooling
false
17,848
[ "MIT" ]
9
ec1ed9438afc4fd3d7a55fd10e6065d2ecc861c4
https://github.com/RayTzeng/s3m-membership-inference/tree/ec1ed9438afc4fd3d7a55fd10e6065d2ecc861c4
Fusion3_MinusFCLayer
import torch from torch import nn class Fusion3_MinusFCLayer(nn.Module): def __init__(self, input_dim): super(Fusion3_MinusFCLayer, self).__init__() self._norm_layer1 = nn.Linear(input_dim * 6, input_dim) def forward(self, input1, input2, input3): norm_input = self._norm_layer1(torch...
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...
RUCAIBox/WSDM2022-C2CRS
Fusion3_MinusFCLayer
false
17,850
[ "MIT" ]
4
8ef2fa7c44bdba1799ab79f379ae7394bd468c02
https://github.com/RUCAIBox/WSDM2022-C2CRS/tree/8ef2fa7c44bdba1799ab79f379ae7394bd468c02
BinaryNLLEntropy
import torch import torch.nn.functional as F import torch.utils.checkpoint from torch.nn.modules.loss import _Loss import torch.jit class BinaryNLLEntropy(_Loss): def __init__(self, size_average=True): super(BinaryNLLEntropy, self).__init__() self.size_average = size_average def forward(self...
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...
RoderickGu/Pretraining_GPT
BinaryNLLEntropy
false
17,851
[ "Apache-2.0" ]
4
0a3ecd38116dc271e273f57490b9b45b660bf401
https://github.com/RoderickGu/Pretraining_GPT/tree/0a3ecd38116dc271e273f57490b9b45b660bf401
GAT
import torch import torch.nn as nn from torch.nn.parameter import Parameter import torch.nn.functional as F class GraphAttentionLayer(nn.Module): """ Simple GAT layer, similar to https://arxiv.org/abs/1710.10903 """ def __init__(self, in_features, out_features, dropout, alpha): super(GraphAtt...
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....
RidongHan/GHE-LPC
GAT
false
17,852
[ "MIT" ]
4
2a10f423d747aa28560a3bcbf29f7ec87422beb8
https://github.com/RidongHan/GHE-LPC/tree/2a10f423d747aa28560a3bcbf29f7ec87422beb8
NormKLLoss
import torch import torch.utils.checkpoint import torch as th from torch.nn.modules.loss import _Loss import torch.jit class NormKLLoss(_Loss): def __init__(self, unit_average=False): super(NormKLLoss, self).__init__() self.unit_average = unit_average def forward(self, recog_mu, recog_logvar...
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 torch.utils.checkpoint from torch.nn.modules.loss import _Loss imp...
RoderickGu/Pretraining_GPT
NormKLLoss
false
17,853
[ "Apache-2.0" ]
4
0a3ecd38116dc271e273f57490b9b45b660bf401
https://github.com/RoderickGu/Pretraining_GPT/tree/0a3ecd38116dc271e273f57490b9b45b660bf401
first_conv
import torch import torch.nn as nn import torch.nn.functional as F class first_conv(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=False): super(first_conv, self).__init__(in_channels, out_channels, kernel_size, 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
RuiLin0212/BATMANN
first_conv
false
17,854
[ "MIT" ]
6
5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
https://github.com/RuiLin0212/BATMANN/tree/5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
Hidden2Discrete
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint import torch.jit class Hidden2Discrete(nn.Module): def __init__(self, input_size, y_size, k_size, is_lstm=False, has_bias=True ): super(Hidden2Discrete, self).__init__() self.y_size = y_size ...
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....
RoderickGu/Pretraining_GPT
Hidden2Discrete
false
17,855
[ "Apache-2.0" ]
4
0a3ecd38116dc271e273f57490b9b45b660bf401
https://github.com/RoderickGu/Pretraining_GPT/tree/0a3ecd38116dc271e273f57490b9b45b660bf401
Generator
import torch import torch.distributed import torch import torch.nn as nn def gumbel_softmax(logits, tau=1.0, hard=False, log_mode=True, dim=-1): while True: gumbels = -torch.empty_like(logits).exponential_().log() gumbels = (logits + gumbels) / tau if log_mode: y_soft = gumbels...
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....
RowitZou/CG-nAR
Generator
false
17,856
[ "MIT" ]
8
8e2debeb3170045592b3b674ea6f9b56251e71f4
https://github.com/RowitZou/CG-nAR/tree/8e2debeb3170045592b3b674ea6f9b56251e71f4
last_fc
import torch import torch.nn as nn import torch.nn.functional as F class last_fc(nn.Linear): def __init__(self, in_features, out_features, bias=True): super(last_fc, self).__init__(in_features, out_features, bias) self.layer_type = 'LFC' self.transform = None 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
RuiLin0212/BATMANN
last_fc
false
17,857
[ "MIT" ]
6
5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
https://github.com/RuiLin0212/BATMANN/tree/5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
TransformerEncoderFeedForward
import torch import torch.nn as nn class Dense(nn.Module): def __init__(self, in_dim, out_dim, use_bias=True, activation=None, name=None): super(Dense, self).__init__() self.in_dim = in_dim self.out_dim = out_dim self.use_bias = use_bias self.activation = activatio...
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....
RoySadaka/lpd
TransformerEncoderFeedForward
false
17,858
[ "MIT" ]
4
921454d9730d8228f4b0ca5349b0558ebd123c65
https://github.com/RoySadaka/lpd/tree/921454d9730d8228f4b0ca5349b0558ebd123c65
MultiHeadAttention
import torch import torch as th import torch.nn as nn class MultiHeadAttention(nn.Module): def __init__(self, hidden_size, attention_dropout_rate, num_heads): super(MultiHeadAttention, self).__init__() self.num_heads = num_heads self.att_size = att_size = hidden_size // num_heads ...
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....
Roestlab/massformer
MultiHeadAttention
false
17,859
[ "BSD-2-Clause" ]
6
c6324970c392f8ee96651679f49d21e430caa0c9
https://github.com/Roestlab/massformer/tree/c6324970c392f8ee96651679f49d21e430caa0c9
SelfAttn
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint import torch as th import torch.jit class SelfAttn(nn.Module): def __init__(self, hidden_size): super(SelfAttn, self).__init__() self.query = nn.Linear(hidden_size, 1) def forward(self, keys, val...
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....
RoderickGu/Pretraining_GPT
SelfAttn
false
17,860
[ "Apache-2.0" ]
4
0a3ecd38116dc271e273f57490b9b45b660bf401
https://github.com/RoderickGu/Pretraining_GPT/tree/0a3ecd38116dc271e273f57490b9b45b660bf401
AttentionBlock
import math import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.optim def convert_pad_shape(pad_shape): """ Used to get arguments for F.pad """ l = pad_shape[::-1] pad_shape = [item for sublist in l for item in sublist] return pad_shape ...
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....
Royeqiu/Nemo_ASR
AttentionBlock
false
17,861
[ "Apache-2.0" ]
10
12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
https://github.com/Royeqiu/Nemo_ASR/tree/12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
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 =...
RowitZou/CG-nAR
Classifier
false
17,862
[ "MIT" ]
8
8e2debeb3170045592b3b674ea6f9b56251e71f4
https://github.com/RowitZou/CG-nAR/tree/8e2debeb3170045592b3b674ea6f9b56251e71f4
FCN8VGG16
import torch import numpy as np import torch.nn as nn import torch.utils.model_zoo as model_zoo def conv3x3(in_planes, out_planes, stride=1, padding=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=(3, 3), stride=( stride, stride), padding=(padding, padding)) ...
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 numpy as np import tor...
IssamLaradji/looc
FCN8VGG16
false
17,863
[ "Apache-2.0" ]
9
50a05b9bf2d36cd8770add8cc65f9bab1ad45841
https://github.com/IssamLaradji/looc/tree/50a05b9bf2d36cd8770add8cc65f9bab1ad45841
XNOR_BinarizeConv2d
from torch.autograd import Function import torch import torch.nn as nn import torch.nn.functional as F class XNOR_BinaryQuantize(Function): @staticmethod def forward(ctx, input): ctx.save_for_backward(input) out = torch.sign(input) return out @staticmethod def backward(ctx, g...
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.autograd...
RuiLin0212/BATMANN
XNOR_BinarizeConv2d
false
17,864
[ "MIT" ]
6
5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
https://github.com/RuiLin0212/BATMANN/tree/5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
MOTION_ReplaceBlock_B
import torch import torch.nn.parallel import torch.optim import torch import torch.nn as nn class MOTION_ReplaceBlock_B(nn.Module): """ using diff """ def __init__(self, in_channels, n_segment, n_div): super(MOTION_ReplaceBlock_B, self).__init__() self.n_div = n_div self.fold ...
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.parallel import torch.optim import torch import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stri...
RongchangLi/DEN
MOTION_ReplaceBlock_B
false
17,865
[ "MIT" ]
4
f8b744f96a3a68cf0784080ffd561a5279715727
https://github.com/RongchangLi/DEN/tree/f8b744f96a3a68cf0784080ffd561a5279715727
MOTION_Channel_ReplaceBlock
import torch import torch.nn.parallel import torch.optim import torch import torch.nn as nn class MOTION_Channel_ReplaceBlock(nn.Module): def __init__(self, in_channels, n_segment, n_div): super(MOTION_Channel_ReplaceBlock, self).__init__() self.n_div = n_div self.fold = in_channels // 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 import torch.nn.parallel import torch.optim import torch import torch.nn as nn a...
RongchangLi/DEN
MOTION_Channel_ReplaceBlock
false
17,866
[ "MIT" ]
4
f8b744f96a3a68cf0784080ffd561a5279715727
https://github.com/RongchangLi/DEN/tree/f8b744f96a3a68cf0784080ffd561a5279715727
DiceBCELoss
import torch from torch import nn import torch.nn.functional as F class DiceBCELoss(nn.Module): def __init__(self, weight=None, size_average=True): super(DiceBCELoss, self).__init__() def forward(self, inputs, targets, smooth=1): inputs = torch.sigmoid(inputs) inputs = inputs.view(-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 from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math from torch ...
SH-96/polyp-segmentation-pytorch
DiceBCELoss
false
17,867
[ "MIT" ]
3
14ecd2998874a4d26c442bacc3ec69c2d42642f1
https://github.com/SH-96/polyp-segmentation-pytorch/tree/14ecd2998874a4d26c442bacc3ec69c2d42642f1
LayerNorm
import torch from torch import nn import torch.utils.data import torch.optim class LayerNorm(nn.Module): def __init__(self, channels, eps=0.0001): super().__init__() self.channels = channels self.eps = eps self.gamma = nn.Parameter(torch.ones(channels)) self.beta = nn.Para...
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 from torch import nn import torch.utils.data import torch.optim assert_size_str...
Royeqiu/Nemo_ASR
LayerNorm
false
17,868
[ "Apache-2.0" ]
10
12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
https://github.com/Royeqiu/Nemo_ASR/tree/12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
MultiHeadAttention
import math import torch from torch import nn import torch.utils.data import torch.optim class MultiHeadAttention(nn.Module): """ Multi-head scaled dot-product attention layer. Args: hidden_size: size of the embeddings in the model, also known as d_model num_attention_heads: number of hea...
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....
Royeqiu/Nemo_ASR
MultiHeadAttention
false
17,869
[ "Apache-2.0" ]
10
12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
https://github.com/Royeqiu/Nemo_ASR/tree/12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
binary_last_fc
from torch.autograd import Function import torch import torch.nn as nn import torch.nn.functional as F class XNOR_BinaryQuantize(Function): @staticmethod def forward(ctx, input): ctx.save_for_backward(input) out = torch.sign(input) return out @staticmethod def backward(ctx, g...
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.autograd...
RuiLin0212/BATMANN
binary_last_fc
false
17,870
[ "MIT" ]
6
5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
https://github.com/RuiLin0212/BATMANN/tree/5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2
ValueNetwork
import torch import torch.nn as nn import torch.nn.functional as F class ValueNetwork(nn.Module): def __init__(self, input_dim, output_dim, init_w=0.003): super(ValueNetwork, self).__init__() self.fc1 = nn.Linear(input_dim, 256) self.fc2 = nn.Linear(256, 256) self.fc3 = nn.Linear(...
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_...
SAMMiCA/DL_based_E2E_Driving
ValueNetwork
false
17,871
[ "MIT" ]
4
01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
https://github.com/SAMMiCA/DL_based_E2E_Driving/tree/01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
RMSELoss
import torch import torch.nn as nn class RMSELoss(torch.nn.Module): def __init__(self): super(RMSELoss, self).__init__() def forward(self, x, y): criterion = nn.MSELoss() loss = torch.sqrt(criterion(x, y)) return loss 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._inductor.runtime.triton_helpers import libdevice assert_size_stride = torch._...
SAMMiCA/DL_based_E2E_Driving
RMSELoss
false
17,872
[ "MIT" ]
4
01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
https://github.com/SAMMiCA/DL_based_E2E_Driving/tree/01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
InvConvNear
import torch from torch.nn import functional as F from torch import nn import torch.utils.data import torch.optim class InvConvNear(nn.Module): def __init__(self, channels, n_split=4, no_jacobian=False, **kwargs): super().__init__() assert n_split % 2 == 0 self.channels = channels ...
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.data import torch.optim assert_size_stri...
Royeqiu/Nemo_ASR
InvConvNear
false
17,873
[ "Apache-2.0" ]
10
12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
https://github.com/Royeqiu/Nemo_ASR/tree/12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
ConvGLU
import torch from torch import nn import torch.utils.data import torch.optim def str2act(txt): """Translates text to neural network activation""" return {'sigmoid': nn.Sigmoid(), 'relu': nn.ReLU(), 'none': nn. Sequential(), 'lrelu': nn.LeakyReLU(0.2), 'selu': nn.SELU()}[txt. lower()] class 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 import nn import torch.utils.data import torch.optim assert_size_stri...
Royeqiu/Nemo_ASR
ConvGLU
false
17,874
[ "Apache-2.0" ]
10
12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
https://github.com/Royeqiu/Nemo_ASR/tree/12b91b06dc5e4d0aa29d43bc7e701a93ee5eec4e
MOTION_ReplaceBlock_D
import torch import torch.nn.parallel import torch.optim import torch import torch.nn as nn class MOTION_ReplaceBlock_D(nn.Module): """ reuse conv """ def __init__(self, in_channels, n_segment, n_div): super(MOTION_ReplaceBlock_D, self).__init__() self.n_div = n_div self.fold...
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.parallel import torch.optim import torch import torch.nn as nn a...
RongchangLi/DEN
MOTION_ReplaceBlock_D
false
17,875
[ "MIT" ]
4
f8b744f96a3a68cf0784080ffd561a5279715727
https://github.com/RongchangLi/DEN/tree/f8b744f96a3a68cf0784080ffd561a5279715727
TransformerEncoderLayer
import math import torch from typing import Callable from typing import Optional from typing import Tuple from typing import List from typing import Dict from typing import Union from typing import Any import torch.utils.data import torch.nn.functional as F import torch.nn import torch.cuda import torch.backends.cudnn ...
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....
RobertCsordas/tcf
TransformerEncoderLayer
false
17,876
[ "MIT" ]
5
da20530dfb4336deddfbe5e79d62e72d1dc2580e
https://github.com/RobertCsordas/tcf/tree/da20530dfb4336deddfbe5e79d62e72d1dc2580e
EncoderLayer
import torch import torch as th import torch.nn as nn class FeedForwardNetwork(nn.Module): def __init__(self, hidden_size, ffn_size, dropout_rate): super(FeedForwardNetwork, self).__init__() self.layer1 = nn.Linear(hidden_size, ffn_size) self.gelu = nn.GELU() self.layer2 = 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....
Roestlab/massformer
EncoderLayer
false
17,877
[ "BSD-2-Clause" ]
6
c6324970c392f8ee96651679f49d21e430caa0c9
https://github.com/Roestlab/massformer/tree/c6324970c392f8ee96651679f49d21e430caa0c9
SoftQNetwork
import torch import torch.nn as nn import torch.nn.functional as F class SoftQNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size=256, init_w=0.003): super(SoftQNetwork, self).__init__() self.linear1 = nn.Linear(num_inputs + num_actions, hidden_size) self.linear2 =...
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_...
SAMMiCA/DL_based_E2E_Driving
SoftQNetwork
false
17,878
[ "MIT" ]
4
01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
https://github.com/SAMMiCA/DL_based_E2E_Driving/tree/01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
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 ...
RowitZou/CG-nAR
PositionwiseFeedForward
false
17,879
[ "MIT" ]
8
8e2debeb3170045592b3b674ea6f9b56251e71f4
https://github.com/RowitZou/CG-nAR/tree/8e2debeb3170045592b3b674ea6f9b56251e71f4
GlobalAvgPool2d
import torch from torch import nn import torch.nn.functional as F class GlobalAvgPool2d(nn.Module): def __init__(self): super(GlobalAvgPool2d, self).__init__() def forward(self, x): return F.avg_pool2d(x, kernel_size=x.size()[2:]) def get_inputs(): return [torch.rand([4, 4, 4, 4])] d...
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 assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
Sandy1230/Dive-into-DL-PyTorch-master
GlobalAvgPool2d
false
17,880
[ "Apache-2.0" ]
4
eca149f6b706a4e6a7b377707deab22341b014d1
https://github.com/Sandy1230/Dive-into-DL-PyTorch-master/tree/eca149f6b706a4e6a7b377707deab22341b014d1
PolicyNetwork
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal class PolicyNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size=256, init_w= 0.003, log_std_min=-20, log_std_max=2): super(PolicyNetwork, self).__init__() 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 import triton_helpers import torch.nn as nn from to...
SAMMiCA/DL_based_E2E_Driving
PolicyNetwork
false
17,881
[ "MIT" ]
4
01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
https://github.com/SAMMiCA/DL_based_E2E_Driving/tree/01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
CorrConv
from torch.autograd import Function import torch import torch.nn as nn from torch.autograd import Variable import torch.utils.data import torch.nn.parallel class CorrConvFunction(Function): @staticmethod def forward(ctx, input, weight, bias=None, stride=1, padding=0, lamda=0.005 ): ctx.save_f...
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.autograd import Function import torch.nn as nn from torch.autograd im...
SCUT-AILab/CorrReg
CorrConv
false
17,882
[ "MIT" ]
5
3635d237effd0c7dd1d2a831f8ab14e30edac561
https://github.com/SCUT-AILab/CorrReg/tree/3635d237effd0c7dd1d2a831f8ab14e30edac561
SELECT_fusion_block
import torch import torch.nn.parallel import torch.optim import torch import torch.nn as nn class SELECT_fusion_block(nn.Module): def __init__(self, in_channels, n_segment, n_div): super(SELECT_fusion_block, self).__init__() self.n_div = n_div self.fold = in_channels // n_div 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 import triton_helpers import torch.nn.parallel impo...
RongchangLi/DEN
SELECT_fusion_block
false
17,883
[ "MIT" ]
4
f8b744f96a3a68cf0784080ffd561a5279715727
https://github.com/RongchangLi/DEN/tree/f8b744f96a3a68cf0784080ffd561a5279715727
CONV1d_FusionBlock
import torch import torch.nn.parallel import torch.optim import torch import torch.nn as nn class CONV1d_FusionBlock(nn.Module): def __init__(self, in_channels, n_segment, n_div): super(CONV1d_FusionBlock, self).__init__() self.n_div = n_div self.fold = in_channels // n_div self.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 import torch.nn.parallel import torch.optim import torch import torch.nn as nn a...
RongchangLi/DEN
CONV1d_FusionBlock
false
17,884
[ "MIT" ]
4
f8b744f96a3a68cf0784080ffd561a5279715727
https://github.com/RongchangLi/DEN/tree/f8b744f96a3a68cf0784080ffd561a5279715727
channel_attention
import torch from torch import nn class channel_attention(nn.Module): def __init__(self, in_channels, feature_size): super(channel_attention, self).__init__() self.fc1 = nn.Linear(feature_size * feature_size, feature_size, bias=False) self.relu1 = nn.ReLU(inplace=True) ...
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....
SCUT-AILab/AFA
channel_attention
false
17,885
[ "BSD-3-Clause" ]
7
acfb42236ce0114d63f22a821fc5954c8c149f45
https://github.com/SCUT-AILab/AFA/tree/acfb42236ce0114d63f22a821fc5954c8c149f45
MLPSoftQNetwork
import torch import torch.nn as nn import torch.nn.functional as F class MLPSoftQNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size1=1400, hidden_size2=1024, hidden_size3=256, init_w=0.003): super(MLPSoftQNetwork, self).__init__() self.linear1 = nn.Linear(num_inpu...
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_...
SAMMiCA/DL_based_E2E_Driving
MLPSoftQNetwork
false
17,886
[ "MIT" ]
4
01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
https://github.com/SAMMiCA/DL_based_E2E_Driving/tree/01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
Fusion
import torch import torch.nn as nn class Fusion(nn.Module): """ Crazy multi-modal fusion: negative squared difference minus relu'd sum """ def __init__(self): super().__init__() def forward(self, x, y): return -(x - y) ** 2 + torch.relu(x + y) def get_inputs(): return [torch.ra...
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...
Ruiver/CTCNet
Fusion
false
17,887
[ "Apache-2.0" ]
6
539e55ec9fed06028379d35dfd5cd4074755ffd8
https://github.com/Ruiver/CTCNet/tree/539e55ec9fed06028379d35dfd5cd4074755ffd8
EncoderBlock
import torch import torch.nn.functional as F from torch import nn class EncoderBlock(nn.Module): """ Encoder block class """ def __init__(self, in_channels, out_channels, k_size, pad_size): super(EncoderBlock, self).__init__() self.conv1 = nn.Conv3d(in_channels, out_channels, kernel_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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
SVRTK/Segmentation_FetalMRI
EncoderBlock
false
17,888
[ "Apache-2.0" ]
6
9344a2248cbe8e4cccbe05ca98214626dcf62805
https://github.com/SVRTK/Segmentation_FetalMRI/tree/9344a2248cbe8e4cccbe05ca98214626dcf62805
pixel_attention
import torch from torch import nn class pixel_attention(nn.Module): def __init__(self, in_channels, feature_size): super(pixel_attention, self).__init__() self.fc1 = nn.Linear(feature_size * feature_size, feature_size, bias=False) self.relu1 = nn.ReLU(inplace=True) 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 import triton_helpers from torch._inductor.runtime....
SCUT-AILab/AFA
pixel_attention
false
17,889
[ "BSD-3-Clause" ]
7
acfb42236ce0114d63f22a821fc5954c8c149f45
https://github.com/SCUT-AILab/AFA/tree/acfb42236ce0114d63f22a821fc5954c8c149f45
QREmbeddingBag
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter class QREmbeddingBag(nn.Module): """Computes sums or means over two 'bags' of embeddings, one using the quotient of the indices and the other using the remainder of the indices, witho...
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 numpy as np import torch.nn as nn from torch.nn.parameter import Paramet...
STAR-Laboratory/Accelerating-RecSys-Training
QREmbeddingBag
false
17,890
[ "MIT" ]
5
e43cae6fd543813b352b01510e846febd67944ad
https://github.com/STAR-Laboratory/Accelerating-RecSys-Training/tree/e43cae6fd543813b352b01510e846febd67944ad
Classifier
import torch import torch.nn as nn class FCNet(nn.Module): def __init__(self, in_size, out_size, activate=None, drop=0.0): super(FCNet, self).__init__() self.lin = nn.Linear(in_size, out_size) self.drop_value = drop self.drop = nn.Dropout(drop) self.activate = activate.low...
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...
Ruiver/CTCNet
Classifier
false
17,891
[ "Apache-2.0" ]
6
539e55ec9fed06028379d35dfd5cd4074755ffd8
https://github.com/Ruiver/CTCNet/tree/539e55ec9fed06028379d35dfd5cd4074755ffd8
MLPPolicyNetwork
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal class MLPPolicyNetwork(nn.Module): def __init__(self, num_inputs, num_actions, hidden_size1=1400, hidden_size2=1024, hidden_size3=256, init_w=0.003, log_std_min=-20, log_std_max=2): 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 from torch._inductor.runtime import triton_helpers import torch.nn as nn from to...
SAMMiCA/DL_based_E2E_Driving
MLPPolicyNetwork
false
17,892
[ "MIT" ]
4
01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
https://github.com/SAMMiCA/DL_based_E2E_Driving/tree/01f7d74a0db7ed745cf27b9a1ebab0246015ecbd
HardWeightedSum
import torch from torch import nn class HardWeightedSum(nn.Module): def __init__(self, op_number=2, act=nn.ReLU, eps=0.0001): super(HardWeightedSum, self).__init__() shape = op_number, 1, 1, 1, 1 self.weights = nn.Parameter(torch.ones(shape), requires_grad=True) self.act = act() ...
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...
Senyaaa/detection-experiments
HardWeightedSum
false
17,893
[ "Apache-2.0" ]
5
5e80dd458e886ca27db5420d25ade8f9d74ae5a8
https://github.com/Senyaaa/detection-experiments/tree/5e80dd458e886ca27db5420d25ade8f9d74ae5a8
DecoderBlock
import torch from functools import partial import torch.nn.functional as F from torch import nn class DecoderBlock(nn.Module): """ Decoder block class """ def __init__(self, in_channels, middle_channels, out_channels, k_size, pad_size): super(DecoderBlock, 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._inductor.runtime import triton_helpers from torch._inductor.runtime....
SVRTK/Segmentation_FetalMRI
DecoderBlock
false
17,894
[ "Apache-2.0" ]
6
9344a2248cbe8e4cccbe05ca98214626dcf62805
https://github.com/SVRTK/Segmentation_FetalMRI/tree/9344a2248cbe8e4cccbe05ca98214626dcf62805
SoftMaxWeightedSum
import torch from torch import nn class SoftMaxWeightedSum(nn.Module): def __init__(self, op_number=2): super(SoftMaxWeightedSum, self).__init__() shape = op_number, 1, 1, 1, 1 self.weights = nn.Parameter(torch.ones(shape), requires_grad=True) def forward(self, x): return 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime.triton_helpers import math as tl_math from torch import nn a...
Senyaaa/detection-experiments
SoftMaxWeightedSum
false
17,895
[ "Apache-2.0" ]
5
5e80dd458e886ca27db5420d25ade8f9d74ae5a8
https://github.com/Senyaaa/detection-experiments/tree/5e80dd458e886ca27db5420d25ade8f9d74ae5a8
Decoder
import torch import torch.nn as nn class Decoder(nn.Module): def __init__(self, n_features, n_modes, T): super(Decoder, self).__init__() self.n_modes = n_modes self.T = T self.linear1 = nn.Linear(n_features, 4096) self.linear2 = nn.Linear(512, n_modes * T * 2) 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 import triton_helpers from torch._inductor.runtime....
SambaranRepo/VectorNet_Waymo
Decoder
false
17,896
[ "MIT" ]
4
454016a5020444e78943786c14e4e12a75ce052e
https://github.com/SambaranRepo/VectorNet_Waymo/tree/454016a5020444e78943786c14e4e12a75ce052e
resBlock
import torch import torch.nn as nn import torch.nn.functional as F class resBlock(nn.Module): def __init__(self, channelDepth, windowSize=3): super(resBlock, self).__init__() self.pad = nn.ReflectionPad2d(1) self.IN_conv1 = nn.InstanceNorm2d(channelDepth) self.conv1 = nn.Conv2d(ch...
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....
SeokjaeLIM/DSSN_release-Pytorch
resBlock
false
17,897
[ "Apache-2.0" ]
7
fef1dac120d7b83367b4c69f239b089ab5f004d7
https://github.com/SeokjaeLIM/DSSN_release-Pytorch/tree/fef1dac120d7b83367b4c69f239b089ab5f004d7
WeightedFeatureFusion
import torch import torch.nn as nn from torchvision.models.resnet import * import torch.utils.data class WeightedFeatureFusion(nn.Module): def __init__(self, layers, weight=False): super(WeightedFeatureFusion, self).__init__() self.layers = layers self.weight = weight self.n = len...
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 from torchvision.models.resnet import * import torch.utils.data assert_size_stride = torch._C._dynamo.guards.assert_si...
PanJason/ML_Proj
WeightedFeatureFusion
false
17,898
[ "MIT" ]
4
663be12e8eb6e30e3c902a4984ac0db33bfce605
https://github.com/PanJason/ML_Proj/tree/663be12e8eb6e30e3c902a4984ac0db33bfce605
ConformerFeedForward
import torch from torch import nn import torch.utils.data import torch.optim class Swish(nn.Module): """ Swish activation function introduced in 'https://arxiv.org/abs/1710.05941' """ def forward(self, x): return x * torch.sigmoid(x) class ConformerFeedForward(nn.Module): """ feed-f...
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.data import torch.optim assert_size_stri...
ShantanuNair/NeMo
ConformerFeedForward
false
17,899
[ "Apache-2.0" ]
10
d01b7bbc3fdb1bbf14789f71b8f368cf0aa8f86b
https://github.com/ShantanuNair/NeMo/tree/d01b7bbc3fdb1bbf14789f71b8f368cf0aa8f86b
FusionAttention
import torch import torch.nn.functional as F import torch.nn as nn class FusionAttention(nn.Module): def __init__(self, dim): super(FusionAttention, self).__init__() self.attention_matrix = nn.Linear(dim, dim) self.project_weight = nn.Linear(dim, 1) def forward(self, 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 import triton_helpers from torch._inductor.runtime....
Seondong/Customs-Fraud-Detection
FusionAttention
false
17,900
[ "MIT" ]
7
eb9e4641a78cb32d73787de86dd72ebb09df1452
https://github.com/Seondong/Customs-Fraud-Detection/tree/eb9e4641a78cb32d73787de86dd72ebb09df1452
MultiLayerPerceptron
import torch import torch.utils.data import torch.optim class MultiLayerPerceptron(torch.nn.Module): """ A simple MLP that can either be used independently or put on top of pretrained models (such as BERT) and act as a classifier. Args: hidden_size (int): the size of each layer num_cla...
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....
ShantanuNair/NeMo
MultiLayerPerceptron
false
17,901
[ "Apache-2.0" ]
10
d01b7bbc3fdb1bbf14789f71b8f368cf0aa8f86b
https://github.com/ShantanuNair/NeMo/tree/d01b7bbc3fdb1bbf14789f71b8f368cf0aa8f86b
_Residual_Block
import torch import torch.nn as nn class _Residual_Block(nn.Module): def __init__(self): super(_Residual_Block, self).__init__() self.conv1 = nn.Conv2d(in_channels=64, out_channels=64, kernel_size =3, stride=1, padding=1, bias=False) self.in1 = nn.InstanceNorm2d(64, affine=Tru...
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....
Shandilya21/Improved-Optimization-Tecniques-for-Super-Resoultion-in-Images
_Residual_Block
false
17,902
[ "MIT" ]
10
d903d99706f557d74e00d4395e7d316172a9f7ee
https://github.com/Shandilya21/Improved-Optimization-Tecniques-for-Super-Resoultion-in-Images/tree/d903d99706f557d74e00d4395e7d316172a9f7ee
DyIntraModalityUpdate
import torch import torch.nn as nn import torch.nn.functional as F class FCNet(nn.Module): def __init__(self, in_size, out_size, activate=None, drop=0.0): super(FCNet, self).__init__() self.lin = nn.Linear(in_size, out_size) self.drop_value = drop self.drop = nn.Dropout(drop) ...
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....
Ruiver/CTCNet
DyIntraModalityUpdate
false
17,903
[ "Apache-2.0" ]
6
539e55ec9fed06028379d35dfd5cd4074755ffd8
https://github.com/Ruiver/CTCNet/tree/539e55ec9fed06028379d35dfd5cd4074755ffd8
ResnetDecoder
import torch import torch.nn as nn class ResnetDecoder(nn.Module): """ This class represents the tail of ResNet. It performs a global pooling and maps the output to the correct class by using a fully connected layer. """ def __init__(self, in_features, n_classes): super().__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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
SeffyVon/ECG_MICResNet
ResnetDecoder
false
17,904
[ "BSD-3-Clause" ]
5
8c6a319b5822ddfb130738eb1d9cdc3c21b24209
https://github.com/SeffyVon/ECG_MICResNet/tree/8c6a319b5822ddfb130738eb1d9cdc3c21b24209
Net
import torch import torch.nn as nn import torch.nn.init as init class Net(nn.Module): def __init__(self, upscale_factor): super(Net, self).__init__() self.upscale_factor = int(upscale_factor) self.relu = nn.ReLU() self.conv1 = nn.Conv2d(1, 64, kernel_size=5, padding=2) 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 import triton_helpers import torch.nn as nn import ...
PiSchool/esa-superresolution-forecasting
Net
false
17,905
[ "MIT" ]
4
3c01770dd64749d6b6c40e1068a96a3307c8c035
https://github.com/PiSchool/esa-superresolution-forecasting/tree/3c01770dd64749d6b6c40e1068a96a3307c8c035
OneSideInterModalityUpdate
import torch import torch.nn as nn import torch.nn.functional as F class FCNet(nn.Module): def __init__(self, in_size, out_size, activate=None, drop=0.0): super(FCNet, self).__init__() self.lin = nn.Linear(in_size, out_size) self.drop_value = drop self.drop = nn.Dropout(drop) ...
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....
Ruiver/CTCNet
OneSideInterModalityUpdate
false
17,906
[ "Apache-2.0" ]
6
539e55ec9fed06028379d35dfd5cd4074755ffd8
https://github.com/Ruiver/CTCNet/tree/539e55ec9fed06028379d35dfd5cd4074755ffd8
DiceLoss
import torch import torch.nn as nn class DiceLoss(nn.Module): def __init__(self): super(DiceLoss, self).__init__() def forward(self, input, target): N = target.size(0) smooth = 1 input_flat = input.view(N, -1) target_flat = target.view(N, -1) intersection = in...
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...
SeffyVon/ECG_MICResNet
DiceLoss
false
17,907
[ "BSD-3-Clause" ]
5
8c6a319b5822ddfb130738eb1d9cdc3c21b24209
https://github.com/SeffyVon/ECG_MICResNet/tree/8c6a319b5822ddfb130738eb1d9cdc3c21b24209
deepmind
import torch import torch.nn as nn import torch.nn.functional as F class deepmind(nn.Module): def __init__(self): super(deepmind, self).__init__() self.conv1 = nn.Conv2d(4, 32, 8, stride=4) self.conv2 = nn.Conv2d(32, 64, 4, stride=2) self.conv3 = nn.Conv2d(64, 32, 3, stride=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 import triton_helpers import torch.nn as nn assert_...
Rowing0914/TF2_RL
deepmind
false
17,908
[ "MIT" ]
8
c1b7f9b376cbecf01deb17f76f8e761035ed336a
https://github.com/Rowing0914/TF2_RL/tree/c1b7f9b376cbecf01deb17f76f8e761035ed336a
Bias
import torch import torch.nn as nn class Bias(nn.Module): def __init__(self): super(Bias, self).__init__() self.bias = nn.Parameter(torch.zeros(1)) def forward(self, feat_img, feat_sound): B, C, H, W = feat_sound.size() feat_img = feat_img.view(B, 1, C) z = torch.bmm(...
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...
SheldonTsui/Minus-Plus-Network
Bias
false
17,909
[ "Apache-2.0" ]
5
7aa281b17f637a9f168aaf250039e560027a3817
https://github.com/SheldonTsui/Minus-Plus-Network/tree/7aa281b17f637a9f168aaf250039e560027a3817
projection_model
import torch class projection_model(torch.nn.Module): def __init__(self, neo_hidden, clip_hidden=512): super(projection_model, self).__init__() self.fc1 = torch.nn.Linear(neo_hidden, neo_hidden // 2) self.act = torch.nn.GELU() self.fc2 = torch.nn.Linear(neo_hidden // 2, clip_hidde...
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 assert_size_stride ...
ShivanshuPurohit/GPT-Neo-visual-grounding
projection_model
false
17,910
[ "Apache-2.0" ]
4
9c938257a688ef5ae8bc1b87b61d943aa158e880
https://github.com/ShivanshuPurohit/GPT-Neo-visual-grounding/tree/9c938257a688ef5ae8bc1b87b61d943aa158e880
DSCLoss
import torch import torch.nn as nn class DSCLoss(nn.Module): def __init__(self): super(DSCLoss, self).__init__() def forward(self, input, target): N = target.size(0) smooth = 1 input_flat = input.view(N, -1) target_flat = target.view(N, -1) input_flat * 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
SeffyVon/ECG_MICResNet
DSCLoss
false
17,911
[ "BSD-3-Clause" ]
5
8c6a319b5822ddfb130738eb1d9cdc3c21b24209
https://github.com/SeffyVon/ECG_MICResNet/tree/8c6a319b5822ddfb130738eb1d9cdc3c21b24209
TwoMLPHead
import torch import torch.nn as nn import torch.nn.functional as F class TwoMLPHead(nn.Module): """ Standard heads for FPN-based models Arguments: in_channels (int): number of input channels representation_size (int): size of the intermediate representation """ def __init__(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 import triton_helpers import torch.nn as nn assert_...
Sense-GVT/BigPretrain
TwoMLPHead
false
17,912
[ "Apache-2.0" ]
8
d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
https://github.com/Sense-GVT/BigPretrain/tree/d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
InterModalityUpdate
import torch import torch.nn as nn import torch.nn.functional as F class FCNet(nn.Module): def __init__(self, in_size, out_size, activate=None, drop=0.0): super(FCNet, self).__init__() self.lin = nn.Linear(in_size, out_size) self.drop_value = drop self.drop = nn.Dropout(drop) ...
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....
Ruiver/CTCNet
InterModalityUpdate
false
17,913
[ "Apache-2.0" ]
6
539e55ec9fed06028379d35dfd5cd4074755ffd8
https://github.com/Ruiver/CTCNet/tree/539e55ec9fed06028379d35dfd5cd4074755ffd8
C3D_mini
import torch import torch.nn as nn class C3D_mini(nn.Module): """ The C3D_mini network """ def __init__(self, num_classes=2, pretrained=False): super(C3D_mini, self).__init__() self.conv1 = nn.Conv3d(3, 64, kernel_size=(3, 3, 3), padding=(1, 1, 1)) self.pool1 = nn.MaxPool3d(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 import torch.nn as nn assert_...
Ontheway361/C3D
C3D_mini
false
17,914
[ "MIT" ]
7
7aa5364d8c0c6bddc17b1b8939b198fe66e282ca
https://github.com/Ontheway361/C3D/tree/7aa5364d8c0c6bddc17b1b8939b198fe66e282ca
InnerProd
import torch import torch.nn as nn class InnerProd(nn.Module): def __init__(self, fc_dim): super(InnerProd, self).__init__() self.scale = nn.Parameter(torch.ones(fc_dim)) self.bias = nn.Parameter(torch.zeros(1)) def forward(self, feat_img, feat_sound): sound_size = feat_sound...
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...
SheldonTsui/Minus-Plus-Network
InnerProd
false
17,915
[ "Apache-2.0" ]
5
7aa281b17f637a9f168aaf250039e560027a3817
https://github.com/SheldonTsui/Minus-Plus-Network/tree/7aa281b17f637a9f168aaf250039e560027a3817
Actor
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data class Actor(nn.Module): def __init__(self, nb_states, nb_actions, hidden1=400, hidden2=300, init_w=0.003): super(Actor, self).__init__() self.fc1 = nn.Linear(nb_states, hidden1) ...
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 import ...
Sharpiless/HAQ-for-Mobilenetv3-Quantization
Actor
false
17,916
[ "MIT" ]
5
76b7d98471adb666ad140abd2518bce6f0de3cfa
https://github.com/Sharpiless/HAQ-for-Mobilenetv3-Quantization/tree/76b7d98471adb666ad140abd2518bce6f0de3cfa
FeedForward
import math import torch import torch.nn as nn def activation(act_type='swish'): if act_type == 'swish': act = swish() return act else: act = nn.ReLU(inplace=True) return act class swish(nn.Module): def __init__(self): super(swish, self).__init__() def forwa...
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 ...
Sense-GVT/BigPretrain
FeedForward
false
17,917
[ "Apache-2.0" ]
8
d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
https://github.com/Sense-GVT/BigPretrain/tree/d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
SIMPA
import torch from typing import Optional from typing import Tuple import torch.nn as nn from torch.nn.parameter import Parameter from typing import Union class SIMPA(nn.Module): """The signed mixed-path aggregation model. Args: hop (int): Number of hops to consider. directed (bool, optional):...
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.parameter import Parameter assert_size_strid...
SherylHYX/SSSNET_Signed_Clustering
SIMPA
false
17,918
[ "MIT" ]
5
85736c18e86b396d64177d22b8c7f9859dfd794c
https://github.com/SherylHYX/SSSNET_Signed_Clustering/tree/85736c18e86b396d64177d22b8c7f9859dfd794c
SparseConv2d
import torch import torch.nn as nn import torch.nn.functional as F from torch import autograd class Sparse(autograd.Function): """" Prune the unimprotant weight for the forwards phase, but pass the gradient to dense weight using SR-STE in the backwards phase """ @staticmethod def forward(ctx,...
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....
Sense-GVT/BigPretrain
SparseConv2d
false
17,920
[ "Apache-2.0" ]
8
d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
https://github.com/Sense-GVT/BigPretrain/tree/d8d9b43d94dd1364c18c1e5ba21b85a31cdbba9e
GCNConv_diag
import torch from sklearn.metrics.pairwise import * from torch.optim.lr_scheduler import * class GCNConv_diag(torch.nn.Module): """ A GCN convolution layer of diagonal matrix multiplication """ def __init__(self, input_size, device): super(GCNConv_diag, self).__init__() self.W = torch...
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 sklearn.metrics.pairwise import * from torch.optim.lr_scheduler import * as...
STK101/GRCN
GCNConv_diag
false
17,921
[ "MIT" ]
4
7389000a13d5969bcc77dc4cf73a4107acc68403
https://github.com/STK101/GRCN/tree/7389000a13d5969bcc77dc4cf73a4107acc68403
Balance_Theory
import torch from typing import Optional from typing import Tuple import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from typing import Union class Balance_Theory(nn.Module): """The signed graph clustering model with balance theory, restricted to 2 hops for fair compari...
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....
SherylHYX/SSSNET_Signed_Clustering
Balance_Theory
false
17,922
[ "MIT" ]
5
85736c18e86b396d64177d22b8c7f9859dfd794c
https://github.com/SherylHYX/SSSNET_Signed_Clustering/tree/85736c18e86b396d64177d22b8c7f9859dfd794c