This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch.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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const debounce = (callbackFunction, delay) => { | |
let timeoutId = null; | |
return () => { | |
if (timeoutId !== null) clearTimeout(timeoutId); | |
timeoutId = setTimeout(() => { | |
callbackFunction(); | |
}, delay); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test -------------------------- Importing the Packages --------------------------------- | |
// Test -------------------------- [Path] ----------------- | |
// Test -------------------------- The Server Side Code ---------------------------------- | |
// Test -------------------------- Exporting the server side code ------------------------ |