Belle II Software development
SNEmbedding Class Reference
Inheritance diagram for SNEmbedding:
SN

Public Member Functions

def __init__ (self, num_embeddings, embedding_dim, padding_idx=None, max_norm=None, norm_type=2, scale_grad_by_freq=False, sparse=False, _weight=None, num_svs=1, num_itrs=1, eps=1e-12)
 Constructor.
 
def forward (self, x)
 forward
 

Detailed Description

Embedding layer with spectral norm
We use num_embeddings as the dim instead of embedding_dim here
for convenience sake

Definition at line 799 of file ieagan.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  num_embeddings,
  embedding_dim,
  padding_idx = None,
  max_norm = None,
  norm_type = 2,
  scale_grad_by_freq = False,
  sparse = False,
  _weight = None,
  num_svs = 1,
  num_itrs = 1,
  eps = 1e-12 
)

Constructor.

Reimplemented from SN.

Definition at line 807 of file ieagan.py.

820 ):
821 nn.Embedding.__init__(
822 self,
823 num_embeddings,
824 embedding_dim,
825 padding_idx,
826 max_norm,
827 norm_type,
828 scale_grad_by_freq,
829 sparse,
830 _weight,
831 )
832 SN.__init__(self, num_svs, num_itrs, num_embeddings, eps=eps)
833

Member Function Documentation

◆ forward()

def forward (   self,
  x 
)

forward

Definition at line 835 of file ieagan.py.

835 def forward(self, x):
836 return F.embedding(x, self.W_())
837
838

The documentation for this class was generated from the following file: