Skip to content

Instantly share code, notes, and snippets.

View turnaround5954's full-sized avatar
πŸ’’

turnaround5954

πŸ’’
View GitHub Profile
@turnaround5954
turnaround5954 / ple.py
Created February 28, 2022 04:51
A naive implementation of Progressive Layered Extraction (PLE) in pytorch
"""
Progressive Layered Extraction.
"""
import torch
import torch.nn as nn
class CGCLayer(nn.Module):
"""
@turnaround5954
turnaround5954 / mind_model.py
Last active February 28, 2022 04:48
A naive implementation of MIND
"""
MIND: Multi-Interest Network with Dynamic Routing.
"""
import torch
import torch.nn as nn
import numpy as np
import mind_capsule
import sampled_softmax
@turnaround5954
turnaround5954 / mind_capsule.py
Last active February 28, 2022 04:34
A naive implementation of capsule layer in MIND model
"""
Capsule layer (MIND) in pytorch.
"""
import torch
import torch.nn as nn
torch.manual_seed(0)
class MINDCapsule(nn.Module):
@turnaround5954
turnaround5954 / sampled_softmax.py
Last active February 28, 2022 04:34
A naive implementation of sampled softmax (pytorch)
"""
Sampled softmax in pytorch.
"""
import torch
import torch.nn as nn
import numpy as np
torch.manual_seed(0)