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
VDNNet
import torch import torch.nn as nn class VDNNet(nn.Module): def __init__(self): super(VDNNet, self).__init__() @staticmethod def forward(q_values): return torch.sum(q_values, dim=1) 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...
JJBong/marl
VDNNet
false
2,396
[ "MIT" ]
0
836ea6b478787a728506b6de3c551ce6b10f9ba4
https://github.com/JJBong/marl/tree/836ea6b478787a728506b6de3c551ce6b10f9ba4
NormedLinear
import torch from torch import nn from torch.nn import functional as F from torch.nn import Parameter import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed class NormedLinear(nn.Module): def __init__(self, in_features, out_features): super(NormedLinear, 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....
IssacCyj/imbalanced-semi-self
NormedLinear
false
2,397
[ "MIT" ]
0
33ef166532c94c7ac65b41238c751b0a5369262b
https://github.com/IssacCyj/imbalanced-semi-self/tree/33ef166532c94c7ac65b41238c751b0a5369262b
FocalLoss
import torch from torch import nn from torch.nn import functional as F import torch.nn.parallel import torch.optim import torch.utils.data import torch.utils.data.distributed def focal_loss(input_values, gamma): p = torch.exp(-input_values) loss = (1 - p) ** gamma * input_values return loss.mean() class...
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 i...
IssacCyj/imbalanced-semi-self
FocalLoss
false
2,398
[ "MIT" ]
0
33ef166532c94c7ac65b41238c751b0a5369262b
https://github.com/IssacCyj/imbalanced-semi-self/tree/33ef166532c94c7ac65b41238c751b0a5369262b
L2Loss
import torch from torch import nn import torch as th from functools import * class L2Loss(nn.Module): def __init__(self): super(L2Loss, self).__init__() def forward(self, grad_fake, grad_real): num_pixels = reduce(lambda x, y: x * y, grad_real.size()) return th.sum(th.pow(grad_real -...
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 from functools import * assert_size_stride = torch._C._dynamo.guards...
JaviBite/TFG
L2Loss
false
2,399
[ "MIT" ]
0
e406580697132f53b63a7c983daaa098af45b52c
https://github.com/JaviBite/TFG/tree/e406580697132f53b63a7c983daaa098af45b52c
SphereMSE
import math import torch from numpy import pi from torch import nn from torch.nn.parameter import Parameter import torch as th from torch.nn import Parameter from functools import * class SphereMSE(nn.Module): def __init__(self, h, w): super(SphereMSE, self).__init__() self.h, self.w = h, 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 from torch._inductor.runtime import triton_helpers import math from numpy import pi from torch import nn from torch.nn.parameter import Para...
JaviBite/TFG
SphereMSE
false
2,400
[ "MIT" ]
0
e406580697132f53b63a7c983daaa098af45b52c
https://github.com/JaviBite/TFG/tree/e406580697132f53b63a7c983daaa098af45b52c
UniformBoxWarp
import torch import torch.nn as nn class UniformBoxWarp(nn.Module): def __init__(self, sidelength): super().__init__() self.scale_factor = 2 / sidelength def forward(self, coordinates): return coordinates * self.scale_factor 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_st...
HexagonPrime/pixel-nerf
UniformBoxWarp
false
2,401
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
MultiHeadAttention
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data class MultiHeadAttention(nn.Module): def __init__(self, in_dim, out_dim, out_heads, relation_dim=0, residual =False, projection=True, layer_norm=True): super().__init__() self.in_dim = in_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....
Hcnaeg/DI-engine
MultiHeadAttention
false
2,402
[ "Apache-2.0" ]
0
aba0c629f87649854091e9e59d948f83962e3e1e
https://github.com/Hcnaeg/DI-engine/tree/aba0c629f87649854091e9e59d948f83962e3e1e
MLP
import torch import torch.nn as nn class FC(nn.Module): def __init__(self, in_size, out_size, dropout_r=0.0, use_relu=True): super(FC, self).__init__() self.dropout_r = dropout_r self.use_relu = use_relu self.linear = nn.Linear(in_size, out_size) if use_relu: 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 assert_...
JayZhu0104/openvqa
MLP
false
2,403
[ "Apache-2.0" ]
0
cc2a92dccb08fb87506d5d0dede7dcfa3a1997aa
https://github.com/JayZhu0104/openvqa/tree/cc2a92dccb08fb87506d5d0dede7dcfa3a1997aa
RelPositionMultiHeadedAttention
import math import torch from typing import Optional from typing import Tuple from torch import nn class MultiHeadedAttention(nn.Module): """Multi-Head Attention layer. Args: n_head (int): The number of heads. n_feat (int): The number of features. dropout_rate (float): Dropout rate. ...
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....
InfluencerNGZK/wenet
RelPositionMultiHeadedAttention
false
2,405
[ "Apache-2.0" ]
0
9a3c7f70a78ce675f5e013b1f67a06d1d23fba3e
https://github.com/InfluencerNGZK/wenet/tree/9a3c7f70a78ce675f5e013b1f67a06d1d23fba3e
BahdanauAttention
import math import torch import torch.nn.functional as F import torch.nn as nn from torch.nn import Parameter import torch.optim.lr_scheduler import torch.utils.data import torch.onnx.operators import torch.optim class BaseAttention(nn.Module): """Base class for attention layers.""" def __init__(self, query_...
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, math as tl_math im...
Fei00Wu/espresso
BahdanauAttention
false
2,406
[ "MIT" ]
0
4e8e6e2f9151a87448845c5142611c103dd4580c
https://github.com/Fei00Wu/espresso/tree/4e8e6e2f9151a87448845c5142611c103dd4580c
Project3D
import torch from torch import nn from functools import * class Project3D(nn.Module): """Layer which projects 3D points into a camera with intrinsics K and at position T """ def __init__(self, batch_size, height, width, eps=1e-07): super(Project3D, self).__init__() self.batch_size = batch...
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 from functools import * assert_size_stride = torch._C._dyna...
JaviBite/TFG
Project3D
false
2,407
[ "MIT" ]
0
e406580697132f53b63a7c983daaa098af45b52c
https://github.com/JaviBite/TFG/tree/e406580697132f53b63a7c983daaa098af45b52c
GlobalAveragePooling
import torch import torch.nn as nn class GlobalAveragePooling(nn.Module): def __init__(self): super().__init__() def forward(self, x): return x.mean([2, 3]) 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...
HexagonPrime/pixel-nerf
GlobalAveragePooling
false
2,409
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
AdaAttN
import torch import torch.utils.data import torch import torch.nn as nn def calc_mean_std(feat, eps=1e-05): size = feat.size() assert len(size) == 4 N, C = size[:2] feat_var = feat.view(N, C, -1).var(dim=2) + eps feat_std = feat_var.sqrt().view(N, C, 1, 1) feat_mean = feat.view(N, C, -1).mean(...
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....
JerryLeolfl/AdaAttN
AdaAttN
false
2,412
[ "MIT" ]
0
062c66f7818b344e3730ce9d6df7af03f9acb4f5
https://github.com/JerryLeolfl/AdaAttN/tree/062c66f7818b344e3730ce9d6df7af03f9acb4f5
AddCoords
import torch import torch.nn as nn class AddCoords(nn.Module): """ Source: https://github.com/mkocabas/CoordConv-pytorch/blob/master/CoordConv.py """ def __init__(self, with_r=False): super().__init__() self.with_r = with_r def forward(self, input_tensor): """ Arg...
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...
HexagonPrime/pixel-nerf
AddCoords
false
2,413
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
SSIM
import torch from torch import nn from functools import * class SSIM(nn.Module): """Layer to compute the SSIM loss between a pair of images """ def __init__(self): super(SSIM, self).__init__() self.mu_x_pool = nn.AvgPool2d(3, 1) self.mu_y_pool = nn.AvgPool2d(3, 1) self.sig...
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 f...
JaviBite/TFG
SSIM
false
2,414
[ "MIT" ]
0
e406580697132f53b63a7c983daaa098af45b52c
https://github.com/JaviBite/TFG/tree/e406580697132f53b63a7c983daaa098af45b52c
Sine
import torch import torch.nn as nn class Sine(nn.Module): """Sine Activation Function.""" def __init__(self): super().__init__() def forward(self, x): return torch.sin(30.0 * 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 from torch._inductor.runtime.triton_helpers import math as tl_math import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
HexagonPrime/pixel-nerf
Sine
false
2,415
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
CoordConv
import torch import torch.nn as nn from torch.nn.utils import spectral_norm def mk_conv2d(*args, sn=False, **kwargs): m = nn.Conv2d(*args, **kwargs) if sn: m = spectral_norm(m) return m class AddCoords(nn.Module): """ Source: https://github.com/mkocabas/CoordConv-pytorch/blob/master/Coor...
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.utils import spectral_norm assert_size_strid...
HexagonPrime/pixel-nerf
CoordConv
false
2,416
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
HighwayLayer
import torch import torch.nn.functional as F import torch.nn as nn import torch.jit import torch.jit.quantized import torch.onnx.operators class HighwayLayer(nn.Module): def __init__(self, input_dim, transform_activation=F.relu, gate_activation=F.softmax, gate_bias=-2): 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 from torch._inductor.runtime import triton_helpers from torch._inductor.runtime....
Jeffyrao/translate
HighwayLayer
false
2,417
[ "BSD-3-Clause" ]
0
ab928e0b692f476c0a43ee7f9d0fbd3ecbada2b4
https://github.com/Jeffyrao/translate/tree/ab928e0b692f476c0a43ee7f9d0fbd3ecbada2b4
ResnetBlockFC
import torch import torch.nn as nn import torch.autograd.profiler as profiler class ResnetBlockFC(nn.Module): """ Fully connected ResNet Block class. Taken from DVR code. :param size_in (int): input dimension :param size_out (int): output dimension :param size_h (int): hidden dimension """...
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_...
HexagonPrime/pixel-nerf
ResnetBlockFC
false
2,418
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
FiLMLayer
import torch import torch.nn as nn class FiLMLayer(nn.Module): def __init__(self, input_dim, hidden_dim): super().__init__() self.layer = nn.Linear(input_dim, hidden_dim) def forward(self, x, freq, phase_shift): x = self.layer(x) freq = freq.unsqueeze(1).expand_as(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.triton_helpers import math as tl_math import torch....
HexagonPrime/pixel-nerf
FiLMLayer
false
2,419
[ "BSD-2-Clause" ]
0
298aa7a3451c01e6f19f73f0c756672d3de54bf9
https://github.com/HexagonPrime/pixel-nerf/tree/298aa7a3451c01e6f19f73f0c756672d3de54bf9
Conv3d
import torch import torch.nn as nn class Conv3d(nn.Module): """ This class is for a convolutional layer. 3d卷积 """ def __init__(self, nIn, nOut, kSize, stride=1): """ :param nIn: number of input channels :param nOut: number of output channels :param kSize: kernel si...
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...
IRLSCU/siamban
Conv3d
false
2,421
[ "Apache-2.0" ]
0
abb12d028e93aaee74efc5042a5bb305c7805053
https://github.com/IRLSCU/siamban/tree/abb12d028e93aaee74efc5042a5bb305c7805053
MultiheadAttention
import math import torch import numpy as np import torch.nn.functional as F import torch.nn as nn import torch.jit import torch.jit.quantized import torch.onnx.operators def combine_heads(X): """ Combine heads (the inverse of split heads): 1) Transpose X from (batch size, nheads, sequence length, d_head) ...
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....
Jeffyrao/translate
MultiheadAttention
false
2,422
[ "BSD-3-Clause" ]
0
ab928e0b692f476c0a43ee7f9d0fbd3ecbada2b4
https://github.com/Jeffyrao/translate/tree/ab928e0b692f476c0a43ee7f9d0fbd3ecbada2b4
tfAvgPool3D
import torch from torch import Tensor from torch import nn class tfAvgPool3D(nn.Module): def __init__(self) ->None: super().__init__() self.avgf = nn.AvgPool3d((1, 3, 3), stride=(1, 2, 2)) def forward(self, x: 'Tensor') ->Tensor: if x.shape[-1] != x.shape[-2]: raise Runti...
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...
Jo951128/2021-2-MIP
tfAvgPool3D
false
2,423
[ "MIT" ]
0
511e0a38816d16fdba9631f76cf913ba51c43138
https://github.com/Jo951128/2021-2-MIP/tree/511e0a38816d16fdba9631f76cf913ba51c43138
SineLayer
import torch import numpy as np import torch.nn as nn class SineLayer(nn.Module): def __init__(self, in_features: 'int', out_features: 'int', omega_0: 'float'=30, is_first: 'bool'=False) ->None: """Sine activation function layer with omega_0 scaling. Args: in_features (int): ...
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 ...
Jose-Bastos/DeePyMoD
SineLayer
false
2,424
[ "MIT" ]
0
c043f9314990c9dd67d8f897cb14e107758f326d
https://github.com/Jose-Bastos/DeePyMoD/tree/c043f9314990c9dd67d8f897cb14e107758f326d
ConvSqu
import torch import torch.nn as nn import torch.nn.functional as F def autopad(k, p=None): if p is None: p = k // 2 if isinstance(k, int) else [(x // 2) for x in k] return p class Mish(nn.Module): @staticmethod def forward(x): return x * F.softplus(x).tanh() class ConvSqu(nn.Modul...
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, math as tl_math im...
JuliannaChaykina/social-distance
ConvSqu
false
2,425
[ "Apache-2.0" ]
0
1c8ade043254b78de49a1244d438203ddb38c586
https://github.com/JuliannaChaykina/social-distance/tree/1c8ade043254b78de49a1244d438203ddb38c586
ConvSig
import torch import torch.nn as nn def autopad(k, p=None): if p is None: p = k // 2 if isinstance(k, int) else [(x // 2) for x in k] return p class ConvSig(nn.Module): def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): super(ConvSig, self).__init__() self.conv = nn.Con...
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...
JuliannaChaykina/social-distance
ConvSig
false
2,426
[ "Apache-2.0" ]
0
1c8ade043254b78de49a1244d438203ddb38c586
https://github.com/JuliannaChaykina/social-distance/tree/1c8ade043254b78de49a1244d438203ddb38c586
MP
import torch import torch.nn as nn class MP(nn.Module): def __init__(self, k=2): super(MP, self).__init__() self.m = nn.MaxPool2d(kernel_size=k, stride=k) def forward(self, x): return self.m(x) def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_init_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 from torch._inductor.runtime import triton_helpers import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
JuliannaChaykina/social-distance
MP
false
2,427
[ "Apache-2.0" ]
0
1c8ade043254b78de49a1244d438203ddb38c586
https://github.com/JuliannaChaykina/social-distance/tree/1c8ade043254b78de49a1244d438203ddb38c586
InternalQNetwork
import torch import torch.nn.functional as F import torch.nn as nn class InternalQNetwork(nn.Module): def __init__(self, state_size, action_size, recurrent_size, seed, fc1_units=64, fc2_units=128): super(InternalQNetwork, self).__init__() self.seed = torch.manual_seed(seed) self.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._inductor.runtime import triton_helpers import torch.nn as nn assert_...
Josh-Joseph/tsc-2019
InternalQNetwork
false
2,428
[ "MIT" ]
0
0cb68b69448257ec7fd8d9edaf6b8aa165599554
https://github.com/Josh-Joseph/tsc-2019/tree/0cb68b69448257ec7fd8d9edaf6b8aa165599554
Hardsigmoid
import torch from torch import Tensor from torch import nn class Hardsigmoid(nn.Module): def __init__(self) ->None: super().__init__() def forward(self, x: 'Tensor') ->Tensor: x = (0.2 * x + 0.5).clamp(min=0.0, max=1.0) return x 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...
Jo951128/2021-2-MIP
Hardsigmoid
false
2,429
[ "MIT" ]
0
511e0a38816d16fdba9631f76cf913ba51c43138
https://github.com/Jo951128/2021-2-MIP/tree/511e0a38816d16fdba9631f76cf913ba51c43138
FMNISTModel
import torch from torch import nn import torch.nn.functional as F class FMNISTModel(nn.Module): def __init__(self): super(FMNISTModel, self).__init__() self.conv1 = nn.Conv2d(1, 8, kernel_size=3, padding=1) self.conv2 = nn.Conv2d(8, 16, kernel_size=3, padding=1) self.conv3 = 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._inductor.runtime import triton_helpers from torch._inductor.runtime....
BrandonLMorris/image-classification
FMNISTModel
false
2,430
[ "Apache-2.0" ]
0
6461d735fbf73bfd181b5b16f703a2a8ea53833b
https://github.com/BrandonLMorris/image-classification/tree/6461d735fbf73bfd181b5b16f703a2a8ea53833b
CDilated
import torch import torch.nn as nn class CDilated(nn.Module): """ This class defines the dilated convolution. 空洞卷积 """ def __init__(self, nIn, nOut, kSize, stride=1, d=1): """ :param nIn: number of input channels :param nOut: number of output channels :param kSize:...
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...
IRLSCU/siamban
CDilated
false
2,431
[ "Apache-2.0" ]
0
abb12d028e93aaee74efc5042a5bb305c7805053
https://github.com/IRLSCU/siamban/tree/abb12d028e93aaee74efc5042a5bb305c7805053
DotAttention
import torch from torch import nn import torch.optim class AttentionMechanism(nn.Module): def __init__(self): super(AttentionMechanism, self).__init__() def forward(self, *input): raise NotImplementedError('Implement this.') class DotAttention(AttentionMechanism): 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 import nn import torch.optim assert_size_stride = torch._C._dynamo.gu...
JoshuaGhost/e2expred
DotAttention
false
2,432
[ "MIT" ]
0
f4dee47c41748a64509b68daee83d97919b6c978
https://github.com/JoshuaGhost/e2expred/tree/f4dee47c41748a64509b68daee83d97919b6c978
Classify
import torch import torch.nn as nn def autopad(k, p=None): if p is None: p = k // 2 if isinstance(k, int) else [(x // 2) for x in k] return p class Flatten(nn.Module): @staticmethod def forward(x): return x.view(x.size(0), -1) class Classify(nn.Module): def __init__(self, c1,...
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...
JuliannaChaykina/social-distance
Classify
false
2,433
[ "Apache-2.0" ]
0
1c8ade043254b78de49a1244d438203ddb38c586
https://github.com/JuliannaChaykina/social-distance/tree/1c8ade043254b78de49a1244d438203ddb38c586
Highway
import torch import torch.nn as nn import torch.nn.utils class Highway(nn.Module): def __init__(self, e_word): """ Init Highway. @param e_word (int): Output embedding size of target word. """ super(Highway, self).__init__() self.proj_layer = nn.Linear(e_word, e_word) ...
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 ...
KIONLEE/cs224n
Highway
false
2,434
[ "MIT" ]
0
63054e187fb40d65af058673fe7aa2f22433da6e
https://github.com/KIONLEE/cs224n/tree/63054e187fb40d65af058673fe7aa2f22433da6e
TorchModule
import torch import torch.nn class TorchLinearModule(torch.nn.Module): def __init__(self, in_size, out_size): super(TorchLinearModule, self).__init__() self._linear = torch.nn.Linear(in_size, out_size) def forward(self, x): return self._linear(x) class TorchModule(torch.nn.Module):...
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 ass...
JudeDavis1/ivy
TorchModule
false
2,435
[ "Apache-2.0" ]
0
0f3dc38f978a6ce65fc1ed11110338d635e5c9f3
https://github.com/JudeDavis1/ivy/tree/0f3dc38f978a6ce65fc1ed11110338d635e5c9f3
ShakeResNeXt
import math import torch from torch import nn from numpy import int64 as int64 import torch.nn.functional as F from torch.autograd import Variable class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training=True): if training: alpha = torch.FloatTensor(x1.si...
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 math from torch import...
Josie-Li/ZazuML-easy_AutoML
ShakeResNeXt
false
2,436
[ "MIT" ]
0
e4daabaab9df518c35abdba35a67607d002bee33
https://github.com/Josie-Li/ZazuML-easy_AutoML/tree/e4daabaab9df518c35abdba35a67607d002bee33
MSE
import torch import torch.nn as nn class MSE(nn.Module): def __init__(self): super().__init__() self.loss = nn.MSELoss(reduction='mean') def forward(self, recon, target): return self.loss(recon, target) def get_inputs(): return [torch.rand([4, 4, 4, 4]), 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride emp...
KMU-AELAB/Active_Learning
MSE
false
2,437
[ "MIT" ]
0
bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
https://github.com/KMU-AELAB/Active_Learning/tree/bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
ShakeResNet
import math import torch from torch import nn from numpy import int64 as int64 import torch.nn.functional as F from torch.autograd import Variable class ShakeShake(torch.autograd.Function): @staticmethod def forward(ctx, x1, x2, training=True): if training: alpha = torch.FloatTensor(x1.si...
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 math from torch import...
Josie-Li/ZazuML-easy_AutoML
ShakeResNet
false
2,438
[ "MIT" ]
0
e4daabaab9df518c35abdba35a67607d002bee33
https://github.com/Josie-Li/ZazuML-easy_AutoML/tree/e4daabaab9df518c35abdba35a67607d002bee33
PatchEmbed
import torch from torch import nn class PatchEmbed(nn.Module): """ Image to Patch Embedding """ def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=768): super().__init__() num_patches = img_size // patch_size * (img_size // patch_size) self.img_size = img_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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_st...
IgoshinLab/dino
PatchEmbed
false
2,439
[ "Apache-2.0" ]
0
00abaabd8ad2f4edc414a44166a24211dfb75900
https://github.com/IgoshinLab/dino/tree/00abaabd8ad2f4edc414a44166a24211dfb75900
Policy
import torch import torch.nn.functional as F from torch.autograd import Variable class Policy(torch.nn.Module): def __init__(self, x_size, g_size, u_size, hidden_size=64): super(Policy, self).__init__() self.fc1 = torch.nn.Linear(x_size + g_size, hidden_size) self.fc2 = torch.nn.Linear(hi...
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....
JoshuaHaustein/oracle_server
Policy
false
2,440
[ "BSD-3-Clause" ]
0
9dc54cd03e28eee6d546b811ce32bcc4d16cec0c
https://github.com/JoshuaHaustein/oracle_server/tree/9dc54cd03e28eee6d546b811ce32bcc4d16cec0c
CNN
import torch import torch.nn as nn import torch.nn.utils class CNN(nn.Module): def __init__(self, e_char, e_word): """ Init CNN. @param e_word (int): Output embedding size of target char. @param e_word (int): Output embedding size of target word. """ super(CNN, self).__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.nn as nn import ...
KIONLEE/cs224n
CNN
false
2,441
[ "MIT" ]
0
63054e187fb40d65af058673fe7aa2f22433da6e
https://github.com/KIONLEE/cs224n/tree/63054e187fb40d65af058673fe7aa2f22433da6e
diag_offdiag_maxpool
import torch class diag_offdiag_maxpool(torch.nn.Module): """diag_offdiag_maxpool""" def __init__(self): super(diag_offdiag_maxpool, self).__init__() def forward(self, inputs): max_diag = torch.max(torch.diagonal(inputs, dim1=-2, dim2=-1), dim=2)[0 ] max_val = torch.m...
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 assert_size_stride = t...
JoshuaMitton/InvariantGraphNetworks
diag_offdiag_maxpool
false
2,442
[ "Apache-2.0" ]
0
f6d8f43c7a053425eee785d11c5de91ac50f367c
https://github.com/JoshuaMitton/InvariantGraphNetworks/tree/f6d8f43c7a053425eee785d11c5de91ac50f367c
LastLevelMaxPool
import torch from torchvision.transforms import functional as F import torch.utils.data from torch import nn import torch.nn.functional as F class LastLevelMaxPool(nn.Module): def forward(self, x): return [F.max_pool2d(x, 1, 2, 0)] def get_inputs(): return [torch.rand([4, 4, 4, 4])] def get_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 import torch.utils.data from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._...
AgatheMo/maskscoring_rcnn-1
LastLevelMaxPool
false
2,443
[ "MIT" ]
0
ed6349caa94c2e23c971784c8aeeafc9f85cde63
https://github.com/AgatheMo/maskscoring_rcnn-1/tree/ed6349caa94c2e23c971784c8aeeafc9f85cde63
RankingLoss
import torch import torch.nn as nn class RankingLoss(nn.Module): def __init__(self): super().__init__() self.bce = nn.BCELoss() def forward(self, pred_loss, target_loss): target = (target_loss - target_loss.flip(0))[:target_loss.size(0) // 2] target = target.detach() ...
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...
KMU-AELAB/Active_Learning
RankingLoss
false
2,444
[ "MIT" ]
0
bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
https://github.com/KMU-AELAB/Active_Learning/tree/bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
WordPredictor
import torch import torch.nn.functional as F import torch.nn as nn import torch.jit import torch.jit.quantized import torch.onnx.operators class WordPredictor(nn.Module): def __init__(self, encoder_output_dim, hidden_dim, output_dim, topk_labels_per_source_token=None, use_self_attention=False): 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.functional as...
Jeffyrao/translate
WordPredictor
false
2,445
[ "BSD-3-Clause" ]
0
ab928e0b692f476c0a43ee7f9d0fbd3ecbada2b4
https://github.com/Jeffyrao/translate/tree/ab928e0b692f476c0a43ee7f9d0fbd3ecbada2b4
BasicBlock
import torch import torch.utils.data import torch.nn as nn from collections import OrderedDict from torch.nn.functional import relu def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) class BasicBlock(nn.Module): ...
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....
JunLi-Galios/GPM
BasicBlock
false
2,446
[ "MIT" ]
0
9ea62c52ec5ae09de185fa66b1262e31c90d82a6
https://github.com/JunLi-Galios/GPM/tree/9ea62c52ec5ae09de185fa66b1262e31c90d82a6
BasicConv2d
import torch import torch.nn as nn class BasicConv2d(nn.Module): def __init__(self, in_channels, out_channels, **kwargs): super(BasicConv2d, self).__init__() self.conv = nn.Conv2d(in_channels, out_channels, **kwargs) self.relu = nn.ReLU(inplace=True) def forward(self, x): 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 import torch.nn as nn assert_...
K-ona/template
BasicConv2d
false
2,447
[ "Apache-2.0" ]
0
a9ea81695b8d7eb512ac7bd54c76f14c7dcb30c4
https://github.com/K-ona/template/tree/a9ea81695b8d7eb512ac7bd54c76f14c7dcb30c4
Downsample
import torch import torch.nn as nn import torch.utils.model_zoo def avg_pool_nd(dims, *args, **kwargs): """ Create a 1D, 2D, or 3D average pooling module. """ if dims == 1: return nn.AvgPool1d(*args, **kwargs) elif dims == 2: return nn.AvgPool2d(*args, **kwargs) elif dims == 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 import torch.nn as nn import torch.utils.model_zoo assert_size_stride = torch._C...
KamilDeja/guided-diffusion
Downsample
false
2,448
[ "MIT" ]
0
d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837
https://github.com/KamilDeja/guided-diffusion/tree/d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837
LossPredLoss
import torch import torch.nn as nn class LossPredLoss(nn.Module): def __init__(self): super().__init__() def forward(self, pred_loss, target_loss): pred_loss = (pred_loss - pred_loss.flip(0))[:len(pred_loss) // 2] target_loss = (target_loss - target_loss.flip(0))[:len(target_loss) //...
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...
KMU-AELAB/Active_Learning
LossPredLoss
false
2,449
[ "MIT" ]
0
bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
https://github.com/KMU-AELAB/Active_Learning/tree/bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
CodeLoss
import torch import torch.nn as nn class CodeLoss(nn.Module): def __init__(self): super().__init__() self.loss = nn.MSELoss() def forward(self, origin_logit, trans_logit): origin_code, trans_code = torch.sign(origin_logit), torch.sign( trans_logit) code_balance_lo...
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 ...
KMU-AELAB/Active_Learning
CodeLoss
false
2,450
[ "MIT" ]
0
bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
https://github.com/KMU-AELAB/Active_Learning/tree/bc569c16b5f12b58989a8f3db59b7eb4e35cce1b
ConvBlockFixup
import torch from torch import nn class ConvBlockFixup(nn.Module): def __init__(self, filter_width, input_filters, nb_filters, dilation): super(ConvBlockFixup, self).__init__() self.filter_width = filter_width self.input_filters = input_filters self.nb_filters = nb_filters ...
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...
KartikaySrivadtava/dl-for-har-ea1e9babb2b178cc338dbc72db974325c193c781
ConvBlockFixup
false
2,451
[ "MIT" ]
0
f4fa436000a46df80ec083c8e3692cd21787e5b3
https://github.com/KartikaySrivadtava/dl-for-har-ea1e9babb2b178cc338dbc72db974325c193c781/tree/f4fa436000a46df80ec083c8e3692cd21787e5b3
Actor
import torch import torch.nn as nn import torch.nn.functional as F class Actor(nn.Module): def __init__(self, n_obs, output_dim, hidden_size, init_w=0.003): super(Actor, self).__init__() self.linear1 = nn.Linear(n_obs, hidden_size) self.linear2 = nn.Linear(hidden_size, hidden_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....
KhalilWong/Learn-RL
Actor
false
2,452
[ "MIT" ]
0
9f63c5adafab1413362366d28d8711096ce6648c
https://github.com/KhalilWong/Learn-RL/tree/9f63c5adafab1413362366d28d8711096ce6648c
VAE
import torch import torch.utils.data from torch import nn from torch.nn import functional as F import torch.nn.parallel import torch.onnx import torch.optim import torch.utils.data.distributed class VAE(nn.Module): def __init__(self): super(VAE, self).__init__() self.fc1 = nn.Linear(784, 400) ...
import torch from torch import device 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...
Kabongosalomon/examples
VAE
false
2,453
[ "BSD-3-Clause" ]
0
c4bdf77ca3687c4a43ae3f50f78f63f041f1a0c8
https://github.com/Kabongosalomon/examples/tree/c4bdf77ca3687c4a43ae3f50f78f63f041f1a0c8
LearnedPositionalEmbedding
import torch import torch.nn as nn import torch.utils.data def create_position_ids_from_input_ids(input_ids, padding_idx): """ Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols are ignored. This is modified from fairseq's `utils.make_position...
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....
JuruoMP/Text2SQL-Multiturn
LearnedPositionalEmbedding
false
2,454
[ "Apache-2.0" ]
0
1c7d1a93d638650a63959327a07c804d1d013e0e
https://github.com/JuruoMP/Text2SQL-Multiturn/tree/1c7d1a93d638650a63959327a07c804d1d013e0e
CMDS_Loss
import torch from torch import nn from sklearn.preprocessing import scale as scale def Covariance(m, bias=False, rowvar=True, inplace=False): """ Estimate a covariance matrix given data(tensor). Covariance indicates the level to which two variables vary together. If we examine N-dimensional samples, `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.triton_helpers import libdevice from torch import n...
CyprienGille/Supervised-Autoencoder
CMDS_Loss
false
2,455
[ "MIT" ]
0
fc8a3002d5b06319750601be586c7ca160f2189e
https://github.com/CyprienGille/Supervised-Autoencoder/tree/fc8a3002d5b06319750601be586c7ca160f2189e
PreNet
import torch from torch import nn import torch.nn.functional as F class PreNet(nn.Module): def __init__(self, in_dims, fc1_dims=256, fc2_dims=128, dropout=0.5): super().__init__() self.fc1 = nn.Linear(in_dims, fc1_dims) self.fc2 = nn.Linear(fc1_dims, fc2_dims) self.p = 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 import nn assert_s...
KonstantinPakulev/OSM-one-shot-multispeaker
PreNet
false
2,456
[ "MIT" ]
0
5cee1b6cb7dc7a3b4b24171340855a42824925f7
https://github.com/KonstantinPakulev/OSM-one-shot-multispeaker/tree/5cee1b6cb7dc7a3b4b24171340855a42824925f7
HighwayNetwork
import torch from torch import nn import torch.nn.functional as F class HighwayNetwork(nn.Module): def __init__(self, size): super().__init__() self.W1 = nn.Linear(size, size) self.W2 = nn.Linear(size, size) self.W1.bias.data.fill_(0.0) def forward(self, x): x1 = 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 import nn assert_s...
KonstantinPakulev/OSM-one-shot-multispeaker
HighwayNetwork
false
2,457
[ "MIT" ]
0
5cee1b6cb7dc7a3b4b24171340855a42824925f7
https://github.com/KonstantinPakulev/OSM-one-shot-multispeaker/tree/5cee1b6cb7dc7a3b4b24171340855a42824925f7
T5LayerNorm
import torch import torch.nn as nn import torch.utils.checkpoint class T5LayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-06): """ Construct a layernorm module in the T5 style No bias and no subtraction of mean. """ super().__init__() self.weight = nn.Parameter...
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.checkpoint assert_size_stride = torch....
Hzfinfdu/Black-Box-Tuning
T5LayerNorm
false
2,458
[ "MIT" ]
0
64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
https://github.com/Hzfinfdu/Black-Box-Tuning/tree/64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
DAE_Module
import torch import torch.nn as nn class Encoder(nn.Module): def __init__(self): super(Encoder, self).__init__() self.conv1 = torch.nn.Conv1d(1, 64, 3, padding=1) self.maxp1 = torch.nn.MaxPool1d(2, padding=0) self.conv2 = torch.nn.Conv1d(64, 128, 3, padding=1) self.maxp2 =...
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....
Koukyosyumei/Zatsuon
DAE_Module
false
2,459
[ "Apache-2.0" ]
0
d7f520a282cf00bfd19d2dec300701c21403cba1
https://github.com/Koukyosyumei/Zatsuon/tree/d7f520a282cf00bfd19d2dec300701c21403cba1
Net
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6, 16, 5) ...
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....
Antloup/Deep-large-picture-database-indexing
Net
false
2,460
[ "MIT" ]
0
ac5368805a29376f54eba0657550d73e4739a235
https://github.com/Antloup/Deep-large-picture-database-indexing/tree/ac5368805a29376f54eba0657550d73e4739a235
Decoder
import torch import torch.nn as nn class Decoder(nn.Module): def __init__(self, sampling_rate=16000.0): super(Decoder, self).__init__() self.sampling_rate = sampling_rate self.upsa1 = torch.nn.Upsample(int(sampling_rate / 2)) self.conv3 = torch.nn.Conv1d(128, 64, 3, padding=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 from torch._inductor.runtime....
Koukyosyumei/Zatsuon
Decoder
false
2,461
[ "Apache-2.0" ]
0
d7f520a282cf00bfd19d2dec300701c21403cba1
https://github.com/Koukyosyumei/Zatsuon/tree/d7f520a282cf00bfd19d2dec300701c21403cba1
Critic
import torch import torch.nn as nn import torch.nn.functional as F class Critic(nn.Module): def __init__(self, n_obs, output_dim, hidden_size, init_w=0.003): super(Critic, self).__init__() self.linear1 = nn.Linear(n_obs + output_dim, hidden_size) self.linear2 = nn.Linear(hidden_size, hidd...
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_...
KhalilWong/Learn-RL
Critic
false
2,462
[ "MIT" ]
0
9f63c5adafab1413362366d28d8711096ce6648c
https://github.com/KhalilWong/Learn-RL/tree/9f63c5adafab1413362366d28d8711096ce6648c
NetCustom
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms class NetCustom(nn.Module): def __init__(self): super(NetCustom, self).__init__() self.conv1 = nn.Conv2d(1, 6, 5) self.pool = nn.MaxPool2d(2, 2) self.conv2 = nn.Conv2d(6,...
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....
Antloup/Deep-large-picture-database-indexing
NetCustom
false
2,463
[ "MIT" ]
0
ac5368805a29376f54eba0657550d73e4739a235
https://github.com/Antloup/Deep-large-picture-database-indexing/tree/ac5368805a29376f54eba0657550d73e4739a235
TemperatureHolder
import torch from torch import nn class TemperatureHolder(nn.Module): """Module that holds a temperature as a learnable value. Args: initial_log_temperature (float): Initial value of log(temperature). """ def __init__(self, initial_log_temperature=0): super().__init__() 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.triton_helpers import math as tl_math from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_...
KtechB/pfrl
TemperatureHolder
false
2,464
[ "MIT" ]
0
9be4726d327b7ce32d9008c40119c98c93febad5
https://github.com/KtechB/pfrl/tree/9be4726d327b7ce32d9008c40119c98c93febad5
FCLateActionSAQFunction
import torch import numpy as np from torch import nn from abc import ABCMeta from abc import abstractmethod import torch.nn.functional as F def init_lecun_normal(tensor, scale=1.0): """Initializes the tensor with LeCunNormal.""" fan_in = torch.nn.init._calculate_correct_fan(tensor, 'fan_in') std = scale *...
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 from torch...
KtechB/pfrl
FCLateActionSAQFunction
false
2,465
[ "MIT" ]
0
9be4726d327b7ce32d9008c40119c98c93febad5
https://github.com/KtechB/pfrl/tree/9be4726d327b7ce32d9008c40119c98c93febad5
DiaynDiscrimNet
import torch import torch.nn as nn from torch.nn.init import kaiming_uniform_ import torch.utils.data def weight_init(m): if m.__class__.__name__ == 'Linear': m.weight.data.copy_(kaiming_uniform_(m.weight.data)) m.bias.data.fill_(0) class DiaynDiscrimNet(nn.Module): def __init__(self, f_spa...
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...
KtechB/machina
DiaynDiscrimNet
false
2,466
[ "MIT" ]
0
24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
https://github.com/KtechB/machina/tree/24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
TwoLayerNet
import torch from torch import nn class TwoLayerNet(nn.Module): def __init__(self, input_dim, hidden_size, num_classes): """ :param input_dim: input feature dimension :param hidden_size: hidden dimension :param num_classes: total number of classes """ super(TwoLaye...
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...
Kuga23/Deep-Learning
TwoLayerNet
false
2,467
[ "MIT" ]
0
86980338208c702b6bfcbcfffdb18498e389a56b
https://github.com/Kuga23/Deep-Learning/tree/86980338208c702b6bfcbcfffdb18498e389a56b
BartClassificationHead
import torch import torch.nn as nn import torch.utils.checkpoint class BartClassificationHead(nn.Module): """Head for sentence-level classification tasks.""" def __init__(self, input_dim: 'int', inner_dim: 'int', num_classes: 'int', pooler_dropout: 'float'): super().__init__() self.de...
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 ...
Hzfinfdu/Black-Box-Tuning
BartClassificationHead
false
2,468
[ "MIT" ]
0
64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
https://github.com/Hzfinfdu/Black-Box-Tuning/tree/64eb5505875dc1b242c6f0a2a2f07e4000c24cb4
DiscrimNet
import torch import torch.nn as nn from torch.nn.init import kaiming_uniform_ import torch.utils.data def weight_init(m): if m.__class__.__name__ == 'Linear': m.weight.data.copy_(kaiming_uniform_(m.weight.data)) m.bias.data.fill_(0) class DiscrimNet(nn.Module): def __init__(self, observatio...
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 ...
KtechB/machina
DiscrimNet
false
2,469
[ "MIT" ]
0
24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
https://github.com/KtechB/machina/tree/24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
ModelNet
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.init import kaiming_uniform_ import torch.utils.data def weight_init(m): if m.__class__.__name__ == 'Linear': m.weight.data.copy_(kaiming_uniform_(m.weight.data)) m.bias.data.fill_(0) class ModelNet(nn.Module): ...
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...
KtechB/machina
ModelNet
false
2,470
[ "MIT" ]
0
24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
https://github.com/KtechB/machina/tree/24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
CosineBasisLinear
import torch import numpy as np from torch import nn def cosine_basis_functions(x, n_basis_functions=64): """Cosine basis functions used to embed quantile thresholds. Args: x (torch.Tensor): Input. n_basis_functions (int): Number of cosine basis functions. Returns: ndarray: Embed...
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 ...
KtechB/pfrl
CosineBasisLinear
false
2,471
[ "MIT" ]
0
9be4726d327b7ce32d9008c40119c98c93febad5
https://github.com/KtechB/pfrl/tree/9be4726d327b7ce32d9008c40119c98c93febad5
QNet
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.init import kaiming_uniform_ from torch.nn.init import uniform_ import torch.utils.data def mini_weight_init(m): if m.__class__.__name__ == 'Linear': m.weight.data.copy_(uniform_(m.weight.data, -0.003, 0.003)) m.bias....
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...
KtechB/machina
QNet
false
2,472
[ "MIT" ]
0
24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
https://github.com/KtechB/machina/tree/24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
Classify
import torch import torch.nn as nn def autopad(k, p=None): if p is None: p = k // 2 if isinstance(k, int) else [(x // 2) for x in k] return p class Classify(nn.Module): def __init__(self, c1, c2, k=1, s=1, p=None, g=1): super(Classify, self).__init__() self.aap = nn.AdaptiveAvgP...
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...
Kumaken/fyp-vehicle-counting-system
Classify
false
2,473
[ "MIT" ]
0
51adb3bfc762d5489bc643da5f79bec3fa9eeb84
https://github.com/Kumaken/fyp-vehicle-counting-system/tree/51adb3bfc762d5489bc643da5f79bec3fa9eeb84
TotalVariationLoss
import torch from torch import nn class TotalVariationLoss(nn.Module): def forward(self, img, tv_weight): """ Compute total variation loss. Inputs: - img: PyTorch Variable of shape (1, 3, H, W) holding an input image. - tv_weight: Scalar giving the 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 from torch import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empty_strided_cuda = torch._C._dynamo.guards._empty_str...
Kuga23/Deep-Learning
TotalVariationLoss
false
2,474
[ "MIT" ]
0
86980338208c702b6bfcbcfffdb18498e389a56b
https://github.com/Kuga23/Deep-Learning/tree/86980338208c702b6bfcbcfffdb18498e389a56b
VNet
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.init import kaiming_uniform_ import torch.utils.data def weight_init(m): if m.__class__.__name__ == 'Linear': m.weight.data.copy_(kaiming_uniform_(m.weight.data)) m.bias.data.fill_(0) class VNet(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 import triton_helpers import torch.nn as nn from to...
KtechB/machina
VNet
false
2,475
[ "MIT" ]
0
24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
https://github.com/KtechB/machina/tree/24eca9cc9b89a0e0b9e026282f17c7b9fe2869ab
GMMLoss
import torch import numpy as np import torch.nn as nn class GMMLoss(nn.Module): def __init__(self): super(GMMLoss, self).__init__() def forward(self, x, mu, std, pi): x = x.unsqueeze(-1) distrib = torch.exp(-((x - mu) / std) ** 2 / 2) / (std * np.sqrt(2 * np.pi)) ...
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.nn as nn assert_size_stride = torch._C._dynamo.guards.assert...
LEEYOONHYUNG/MelNet
GMMLoss
false
2,476
[ "MIT" ]
0
ea899847658a2e6784f706663d130c56258839de
https://github.com/LEEYOONHYUNG/MelNet/tree/ea899847658a2e6784f706663d130c56258839de
SELayer
import torch import torch.nn.functional as F import torch.nn as nn class SELayer(nn.Module): def __init__(self, in_channels, reduction): super().__init__() mid_channels = in_channels // reduction self.fc1 = nn.Linear(in_channels, mid_channels) self.fc2 = nn.Linear(mid_channels, 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.nn as nn assert_...
LEGO999/pytorch_image_classification
SELayer
false
2,477
[ "MIT" ]
0
2b9901fdff0620e39becad4db6adb6f88d251352
https://github.com/LEGO999/pytorch_image_classification/tree/2b9901fdff0620e39becad4db6adb6f88d251352
MaxPool2dDynamicSamePadding
import math import torch from torch import nn from torch.nn import functional as F class MaxPool2dDynamicSamePadding(nn.MaxPool2d): """2D MaxPooling like TensorFlow's 'SAME' mode, with a dynamic image size. The padding is operated in forward function by calculating dynamically. """ def __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 import nn assert_size_stride = torch._C._dynamo.guards.assert_size_stride empt...
Kwongy/Pretrained-backbone-Pytorch
MaxPool2dDynamicSamePadding
false
2,478
[ "MIT" ]
0
1b24bb677e0fd420cce32715c1ead8f0c804d707
https://github.com/Kwongy/Pretrained-backbone-Pytorch/tree/1b24bb677e0fd420cce32715c1ead8f0c804d707
TransitionUp
import torch from torch import Tensor import torch.nn as 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): """ Scale t...
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...
LPF2020hit/sttr
TransitionUp
false
2,479
[ "Apache-2.0" ]
0
6460951fb29842d3a7c455a9b06708ff61ee36d3
https://github.com/LPF2020hit/sttr/tree/6460951fb29842d3a7c455a9b06708ff61ee36d3
Encoder
import torch import torch.nn as nn class Encoder(nn.Module): def __init__(self): super(Encoder, self).__init__() self.conv1 = torch.nn.Conv1d(1, 64, 3, padding=1) self.maxp1 = torch.nn.MaxPool1d(2, padding=0) self.conv2 = torch.nn.Conv1d(64, 128, 3, padding=1) self.maxp2 =...
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_...
Koukyosyumei/Zatsuon
Encoder
false
2,480
[ "Apache-2.0" ]
0
d7f520a282cf00bfd19d2dec300701c21403cba1
https://github.com/Koukyosyumei/Zatsuon/tree/d7f520a282cf00bfd19d2dec300701c21403cba1
VanillaRNN
import torch from torch import nn class VanillaRNN(nn.Module): """ An implementation of vanilla RNN using Pytorch Linear layers and activations. You will need to complete the class init function, forward function and hidden layer initialization. """ def __init__(self, input_size, hidden_size, out...
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....
Kuga23/Deep-Learning
VanillaRNN
false
2,481
[ "MIT" ]
0
86980338208c702b6bfcbcfffdb18498e389a56b
https://github.com/Kuga23/Deep-Learning/tree/86980338208c702b6bfcbcfffdb18498e389a56b
MultiHeadAttention
import torch import torch.utils.data from torch import nn import torch.nn.functional as F class MultiHeadAttention(nn.Module): """ input: query --- [N, T_q, query_dim] key --- [N, T_k, key_dim] output: out --- [N, T_q, num_units] """ def __init__(self, query_dim, key_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....
Kyumin-Park/mellotron
MultiHeadAttention
false
2,482
[ "BSD-3-Clause" ]
0
330081d4c23664686e8c68d74a9222ec4633ffa6
https://github.com/Kyumin-Park/mellotron/tree/330081d4c23664686e8c68d74a9222ec4633ffa6
ContentLoss
import torch from torch import nn class ContentLoss(nn.Module): def forward(self, content_weight, content_current, content_original): """ Compute the content loss for style transfer. Inputs: - content_weight: Scalar giving the weighting for the content loss. ...
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...
Kuga23/Deep-Learning
ContentLoss
false
2,483
[ "MIT" ]
0
86980338208c702b6bfcbcfffdb18498e389a56b
https://github.com/Kuga23/Deep-Learning/tree/86980338208c702b6bfcbcfffdb18498e389a56b
rSoftMax
import torch from torch import nn from torch.nn import functional as F class rSoftMax(nn.Module): def __init__(self, radix, cardinality): super().__init__() self.radix = radix self.cardinality = cardinality def forward(self, x): batch = x.size(0) if self.radix > 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 math as tl_math from torch import nn a...
Kwongy/Pretrained-backbone-Pytorch
rSoftMax
false
2,484
[ "MIT" ]
0
1b24bb677e0fd420cce32715c1ead8f0c804d707
https://github.com/Kwongy/Pretrained-backbone-Pytorch/tree/1b24bb677e0fd420cce32715c1ead8f0c804d707
Block
import torch import torch.nn as nn class Block(nn.Module): def __init__(self, in_channels, num_filters, kernel_size, pool_size): super(Block, self).__init__() self.conv = nn.Conv2d(in_channels, num_filters, kernel_size=kernel_size ) self.pool = nn.MaxPool2d(kernel_size=pool_si...
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_...
LRVerkin/tutorials
Block
false
2,485
[ "MIT" ]
0
365757b0dee90f63a53851e40bfad790aca3cf8d
https://github.com/LRVerkin/tutorials/tree/365757b0dee90f63a53851e40bfad790aca3cf8d
ClassificationTestModel
from torch.nn import Module import torch import torch.nn as nn from typing import Any from torch.nn.modules import Module class ClassificationTestModel(Module): def __init__(self, in_chans: 'int'=3, num_classes: 'int'=1000, **kwargs: Any) ->None: super().__init__() self.conv1 = nn.Conv2d(...
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.nn import Module import torch.nn as nn from typing import Any from to...
LaudateCorpus1/torchgeo
ClassificationTestModel
false
2,486
[ "MIT" ]
0
747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
https://github.com/LaudateCorpus1/torchgeo/tree/747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
mlp
import torch import torch.nn as nn import torch.nn.functional as F class mlp(nn.Module): def __init__(self): super(mlp, self).__init__() self.fc1 = nn.Linear(28 * 28, 512) self.fc2 = nn.Linear(512, 256) self.fc3 = nn.Linear(256, 10) def forward(self, x): x = x.view(-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_...
KwanHoo/coding-playgroung
mlp
false
2,487
[ "MIT" ]
0
443c0ccd2ca8fb7b031a87837a4e6f8d0be2560d
https://github.com/KwanHoo/coding-playgroung/tree/443c0ccd2ca8fb7b031a87837a4e6f8d0be2560d
HyperDecoder
import torch import torch.nn as nn import torch.nn.functional as F class HyperDecoder(nn.Module): def __init__(self, input_dim, outputdim=None): super(HyperDecoder, self).__init__() self.input_dim = input_dim self.fc1 = nn.Linear(input_dim, input_dim) self.fc2 = nn.Linear(input_di...
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....
LXie502/point_based_pcgc
HyperDecoder
false
2,488
[ "MIT" ]
0
9c4b577d35276c8674b568efc0b9d2473bb00a70
https://github.com/LXie502/point_based_pcgc/tree/9c4b577d35276c8674b568efc0b9d2473bb00a70
SplAtConv2d
from torch.nn import Module import torch from torch import nn from torch.nn import functional as F from torch.nn import Conv2d from torch.nn import ReLU from torch.nn.modules.utils import _pair class DropBlock2D(object): def __init__(self, *args, **kwargs): raise NotImplementedError class rSoftMax(nn.M...
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....
Kwongy/Pretrained-backbone-Pytorch
SplAtConv2d
false
2,489
[ "MIT" ]
0
1b24bb677e0fd420cce32715c1ead8f0c804d707
https://github.com/Kwongy/Pretrained-backbone-Pytorch/tree/1b24bb677e0fd420cce32715c1ead8f0c804d707
BitEstimator
import torch import torch.nn as nn import torch.nn.functional as F class Bitparm(nn.Module): """ save params """ def __init__(self, channel, final=False): super(Bitparm, self).__init__() self.final = final self.h = nn.Parameter(torch.nn.init.normal_(torch.empty(channel). ...
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, math as tl_math import torch.nn as nn import torch.nn.functional as F assert_s...
LXie502/point_based_pcgc
BitEstimator
false
2,490
[ "MIT" ]
0
9c4b577d35276c8674b568efc0b9d2473bb00a70
https://github.com/LXie502/point_based_pcgc/tree/9c4b577d35276c8674b568efc0b9d2473bb00a70
SegmentationTestModel
from torch.nn import Module import torch import torch.nn as nn from typing import Any from typing import cast from torch.nn.modules import Module class SegmentationTestModel(Module): def __init__(self, in_channels: 'int'=3, classes: 'int'=1000, **kwargs: Any ) ->None: super().__init__() 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.nn import Module import torch.nn as nn from typing import Any from to...
LaudateCorpus1/torchgeo
SegmentationTestModel
false
2,491
[ "MIT" ]
0
747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
https://github.com/LaudateCorpus1/torchgeo/tree/747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
ReconstructionLayer
import torch import torch.nn as nn class ReconstructionLayer(nn.Module): def __init__(self, ratio, input_channel, output_channel): super(ReconstructionLayer, self).__init__() self.deconv_features = nn.ConvTranspose1d(input_channel, output_channel, ratio, stride=ratio) 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 import torch.nn as nn assert_size_stride = torch._C._dynamo.guards.assert_size_s...
LXie502/point_based_pcgc
ReconstructionLayer
false
2,492
[ "MIT" ]
0
9c4b577d35276c8674b568efc0b9d2473bb00a70
https://github.com/LXie502/point_based_pcgc/tree/9c4b577d35276c8674b568efc0b9d2473bb00a70
AttentionPool2d
import math import numpy import torch import numpy as np import torch.nn as nn import torch.utils.model_zoo import torch as th import numpy.matlib def conv_nd(dims, *args, **kwargs): """ Create a 1D, 2D, or 3D convolution module. """ if dims == 1: return nn.Conv1d(*args, **kwargs) elif 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....
KamilDeja/guided-diffusion
AttentionPool2d
false
2,493
[ "MIT" ]
0
d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837
https://github.com/KamilDeja/guided-diffusion/tree/d0eeeb4637379a3ece40c4dd38ccdf5d8ed5e837
DilatedResidualLayer
import torch import torch.nn as nn import torch.nn.functional as F class DilatedResidualLayer(nn.Module): def __init__(self, dilation, in_channels, out_channels): super(DilatedResidualLayer, self).__init__() self.conv_dilated = nn.Conv1d(in_channels, out_channels, 3, padding =dilation...
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_...
LalehSamadfam/tcn-isba
DilatedResidualLayer
false
2,494
[ "MIT" ]
0
cd2d2c27723e77ba658c695b8b0ba64e4835acf4
https://github.com/LalehSamadfam/tcn-isba/tree/cd2d2c27723e77ba658c695b8b0ba64e4835acf4
Critic
import torch import torch.nn as nn import torch.nn.functional as F class Critic(nn.Module): def __init__(self, state_dim, action_dim): super(Critic, self).__init__() self.l1 = nn.Linear(state_dim + action_dim, 7) self.l2 = nn.Linear(7, 6) self.l3 = nn.Linear(6, 1) self.l4 ...
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 ...
LampKang/CityLearn
Critic
false
2,495
[ "MIT" ]
0
d6c178054c385ca991a5384e287f18a1d6380159
https://github.com/LampKang/CityLearn/tree/d6c178054c385ca991a5384e287f18a1d6380159
RQLoss
from torch.nn import Module import torch from typing import cast from torch.nn.modules import Module import torch.nn.functional as F class RQLoss(Module): """The RQ (backwards) loss between class probabilities and predictions. This loss is defined in `'Resolving label uncertainty with implicit generative ...
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....
LaudateCorpus1/torchgeo
RQLoss
false
2,496
[ "MIT" ]
0
747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
https://github.com/LaudateCorpus1/torchgeo/tree/747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
Actor
import torch import torch.nn as nn import torch.nn.functional as F class Actor(nn.Module): def __init__(self, state_dim, action_dim, max_action): super(Actor, self).__init__() self.l1 = nn.Linear(state_dim, 5) self.l2 = nn.Linear(5, 3) self.l3 = nn.Linear(3, action_dim) 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._inductor.runtime import triton_helpers from torch._inductor.runtime....
LampKang/CityLearn
Actor
false
2,497
[ "MIT" ]
0
d6c178054c385ca991a5384e287f18a1d6380159
https://github.com/LampKang/CityLearn/tree/d6c178054c385ca991a5384e287f18a1d6380159
QRLoss
from torch.nn import Module import torch from typing import cast from torch.nn.modules import Module class QRLoss(Module): """The QR (forward) loss between class probabilities and predictions. This loss is defined in `'Resolving label uncertainty with implicit generative models' <https://openreview.net/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._inductor.runtime.triton_helpers import math as tl_math from torch.nn...
LaudateCorpus1/torchgeo
QRLoss
false
2,498
[ "MIT" ]
0
747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
https://github.com/LaudateCorpus1/torchgeo/tree/747a9352b9663e7d0e0c90a8b53533f0bb06c9b3
ArcMarginProduct
import torch from torch import nn from torch.nn import functional as F class ArcMarginProduct(nn.Module): def __init__(self, in_features, out_features): super().__init__() self.weight = nn.Parameter(torch.Tensor(out_features, in_features)) self.reset_parameters() def reset_parameters...
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....
Lascarfo/kaggle-landmark-recognition-2020-1st-place
ArcMarginProduct
false
2,499
[ "MIT" ]
0
f9007d81e59ecd1311bdea5586a426b8973a2eb8
https://github.com/Lascarfo/kaggle-landmark-recognition-2020-1st-place/tree/f9007d81e59ecd1311bdea5586a426b8973a2eb8
AutoEncoderMlp
import abc import torch from torch import nn as nn import torch.nn.functional as F import torch.utils.data class PyTorchModule(nn.Module, metaclass=abc.ABCMeta): """ Keeping wrapper around to be a bit more future-proof. """ pass class AutoEncoderMlp(PyTorchModule): def __init__(self, state_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 import abc from torch import ...
IanWangg/OSRPG
AutoEncoderMlp
false
2,500
[ "MIT" ]
0
2817cfa5049a1bf52110fb30c4cf532d7b8e9b5b
https://github.com/IanWangg/OSRPG/tree/2817cfa5049a1bf52110fb30c4cf532d7b8e9b5b