Skip to content

Instantly share code, notes, and snippets.

View anshkush92's full-sized avatar
🌴
On vacation

Ansh Singh anshkush92

🌴
On vacation
  • Lucknow, Uttar Pradesh
  • 14:22 (UTC +05:30)
  • LinkedIn in/anshkush92
View GitHub Profile
import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
def __init__(self, nHidden):
super(Attention, self).__init__()
self.attention = nn.Linear(nHidden * 2, nHidden * 2)
self.v = nn.Linear(nHidden * 2, 1, bias=False)
import torch
import torch.nn as nn
import torch.nn.functional as F
class Attention(nn.Module):
def __init__(self, nHidden):
super(Attention, self).__init__()
self.attention = nn.Linear(nHidden * 2, nHidden * 2)
self.v = nn.Linear(nHidden * 2, 1, bias=False)
import torch.nn as nn
import torch.nn.functional as F
class BidirectionalGRU(nn.Module):
def __init__(self, nIn, nHidden, nOut):
super(BidirectionalGRU, self).__init__()
self.rnn = nn.GRU(nIn, nHidden, bidirectional=True)
self.embedding = nn.Linear(nHidden * 2, nOut)
def forward(self, input):
@anshkush92
anshkush92 / index.js
Created April 27, 2025 19:56
async screener assessment
const debounce = (callbackFunction, delay) => {
let timeoutId = null;
return () => {
if (timeoutId !== null) clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
callbackFunction();
}, delay);
}
@anshkush92
anshkush92 / Template_nodeJs.js
Last active October 7, 2022 15:41
My template for React codes
// Test -------------------------- Importing the Packages ---------------------------------
// Test -------------------------- [Path] -----------------
// Test -------------------------- The Server Side Code ----------------------------------
// Test -------------------------- Exporting the server side code ------------------------