Skip to content

Instantly share code, notes, and snippets.

View alesee's full-sized avatar

Eniola Alese alesee

View GitHub Profile
import torch.nn as nn
import torch.nn.functional as F
import torch
class SimpleRNN(nn.Module):
"""
Neural Network Module with an embedding layer, a RNN module and an output layer
Arguments:
input_size(int) -- length of the dictionary of embeddings
from torch import *
import torch.nn.functional as F
import torch.nn as nn
class RNNModel(nn.Module):
"""
Neural Network Module with an embedding layer, a recurent module and an output linear layer
Arguments:
rnn_type(str) -- type of rnn module to use options are ['LSTM', 'GRU', 'RNN_TANH', 'RNN_RELU']