Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
gcn_head.GCNHead Class Reference
Inheritance diagram for gcn_head.GCNHead:

Public Member Functions

 __init__ (self, in_channels, num_class, input_key)
 
 forward (self, feat_dict)
 

Public Attributes

 pool
 
 fc
 
 input_key
 

Detailed Description

Definition at line 3 of file gcn_head.py.

Constructor & Destructor Documentation

◆ __init__()

gcn_head.GCNHead.__init__ ( self,
in_channels,
num_class,
input_key )

Definition at line 5 of file gcn_head.py.

8 input_key):
9 super().__init__()
10
11 self.pool = nn.AdaptiveAvgPool2d(1)
12 self.fc = nn.Linear(in_channels, num_class)
13 self.input_key = input_key
14
15

Member Function Documentation

◆ forward()

gcn_head.GCNHead.forward ( self,
feat_dict )

Definition at line 16 of file gcn_head.py.

16 def forward(self, feat_dict):
17 x = feat_dict[self.input_key]
18
19 # N, M, C, T, V = x.shape
20 N, C, T, V = x.shape
21
22 # x = x.view(N * M, C, T, V)
23
24 # global pooling
25 x = self.pool(x)
26 x = x.view(N, C)
27 # x = x.mean(dim=1)
28
29 cls_scores = self.fc(x)
30
31 return cls_scores

Member Data Documentation

◆ fc

gcn_head.GCNHead.fc

Definition at line 12 of file gcn_head.py.

◆ input_key

gcn_head.GCNHead.input_key

Definition at line 13 of file gcn_head.py.

◆ pool

gcn_head.GCNHead.pool

Definition at line 11 of file gcn_head.py.


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