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
""" | |
Progressive Layered Extraction. | |
""" | |
import torch | |
import torch.nn as nn | |
class CGCLayer(nn.Module): | |
""" |
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
""" | |
MIND: Multi-Interest Network with Dynamic Routing. | |
""" | |
import torch | |
import torch.nn as nn | |
import numpy as np | |
import mind_capsule | |
import sampled_softmax |
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
""" | |
Capsule layer (MIND) in pytorch. | |
""" | |
import torch | |
import torch.nn as nn | |
torch.manual_seed(0) | |
class MINDCapsule(nn.Module): |
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
""" | |
Sampled softmax in pytorch. | |
""" | |
import torch | |
import torch.nn as nn | |
import numpy as np | |
torch.manual_seed(0) | |