gcn
Bases: rpn
Graph Convolutional Network (GCN) model within the RPN framework.
This class constructs a GCN architecture using a series of graph_interdependence_layer
components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dims
|
list[int] | tuple[int]
|
List of layer dimensions for the GCN. Must contain at least two dimensions. |
required |
channel_num
|
int
|
Number of channels for interdependence layers. Default is 1. |
1
|
width
|
int
|
Number of parallel heads in each layer. Default is 1. |
1
|
name
|
str
|
Name of the GCN model. Default is 'rpn_gcn'. |
'rpn_gcn'
|
graph
|
graph
|
Predefined graph structure. Default is None. |
None
|
graph_file_path
|
str
|
Path to a file defining the graph structure. Default is None. |
None
|
nodes
|
list
|
List of graph nodes. Required if |
None
|
links
|
list
|
List of graph edges. Required if |
None
|
directed
|
bool
|
Whether the graph is directed. Default is False. |
False
|
with_multihop
|
bool
|
Enables multihop interdependence in graph layers. Default is False. |
False
|
h
|
int
|
Number of hops for multihop interdependence. Default is 1. |
1
|
accumulative
|
bool
|
Accumulate interdependence over hops. Default is False. |
False
|
with_pagerank
|
bool
|
Include PageRank-based processing in layers. Default is False. |
False
|
c
|
float
|
Damping factor for PageRank. Default is 0.15. |
0.15
|
require_data
|
bool
|
Require data input for adjacency matrix processing. Default is False. |
False
|
require_parameters
|
bool
|
Require parameter input for adjacency matrix processing. Default is False. |
False
|
normalization
|
bool
|
Normalize adjacency matrix. Default is True. |
True
|
normalization_mode
|
str
|
Mode of normalization ('row' or 'column'). Default is 'column'. |
'column'
|
self_dependence
|
bool
|
Include self-loops in graph processing. Default is True. |
True
|
with_dual_lphm
|
bool
|
Enable dual LPHM parameter reconciliation. Default is False. |
False
|
with_lorr
|
bool
|
Enable LoRR parameter reconciliation. Default is False. |
False
|
r
|
int
|
Rank parameter for parameter reconciliation. Default is 3. |
3
|
with_residual
|
bool
|
Include residual connections in layers. Default is False. |
False
|
enable_bias
|
bool
|
Enable bias in parameter reconciliation. Default is False. |
False
|
with_batch_norm
|
bool
|
Include batch normalization in layers. Default is False. |
False
|
with_relu
|
bool
|
Include ReLU activation in layers. Default is True. |
True
|
with_softmax
|
bool
|
Include softmax activation in the output layer. Default is True. |
True
|
with_dropout
|
bool
|
Include dropout in layers. Default is False. |
False
|
p
|
float
|
Dropout probability. Default is 0.25. |
0.25
|
device
|
str
|
Device for computation ('cpu' or 'cuda'). Default is 'cpu'. |
'cpu'
|
*args
|
optional
|
Additional positional arguments for superclass. |
()
|
**kwargs
|
optional
|
Additional keyword arguments for superclass. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If |
Source code in tinybig/model/rpn_gcn.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
__init__(dims, channel_num=1, width=1, name='rpn_gcn', graph=None, graph_file_path=None, nodes=None, links=None, directed=False, with_multihop=False, h=1, accumulative=False, with_pagerank=False, c=0.15, require_data=False, require_parameters=False, normalization=True, normalization_mode='column', self_dependence=True, with_dual_lphm=False, with_lorr=False, r=3, with_residual=False, enable_bias=False, with_batch_norm=False, with_relu=True, with_softmax=True, with_dropout=False, p=0.25, device='cpu', *args, **kwargs)
Initializes the GCN (Graph Convolutional Network) model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dims
|
list[int] | tuple[int]
|
List of layer dimensions for the GCN. Must contain at least two dimensions. |
required |
channel_num
|
int
|
Number of channels for interdependence layers. Default is 1. |
1
|
width
|
int
|
Number of parallel heads in each layer. Default is 1. |
1
|
name
|
str
|
Name of the GCN model. Default is 'rpn_gcn'. |
'rpn_gcn'
|
graph
|
graph
|
Predefined graph structure. Default is None. |
None
|
graph_file_path
|
str
|
Path to a file defining the graph structure. Default is None. |
None
|
nodes
|
list
|
List of graph nodes. Required if |
None
|
links
|
list
|
List of graph edges. Required if |
None
|
directed
|
bool
|
Whether the graph is directed. Default is False. |
False
|
with_multihop
|
bool
|
Enables multihop interdependence in graph layers. Default is False. |
False
|
h
|
int
|
Number of hops for multihop interdependence. Default is 1. |
1
|
accumulative
|
bool
|
Accumulate interdependence over hops. Default is False. |
False
|
with_pagerank
|
bool
|
Include PageRank-based processing in layers. Default is False. |
False
|
c
|
float
|
Damping factor for PageRank. Default is 0.15. |
0.15
|
require_data
|
bool
|
Require data input for adjacency matrix processing. Default is False. |
False
|
require_parameters
|
bool
|
Require parameter input for adjacency matrix processing. Default is False. |
False
|
normalization
|
bool
|
Normalize adjacency matrix. Default is True. |
True
|
normalization_mode
|
str
|
Mode of normalization ('row' or 'column'). Default is 'column'. |
'column'
|
self_dependence
|
bool
|
Include self-loops in graph processing. Default is True. |
True
|
with_dual_lphm
|
bool
|
Enable dual LPHM parameter reconciliation. Default is False. |
False
|
with_lorr
|
bool
|
Enable LoRR parameter reconciliation. Default is False. |
False
|
r
|
int
|
Rank parameter for parameter reconciliation. Default is 3. |
3
|
with_residual
|
bool
|
Include residual connections in layers. Default is False. |
False
|
enable_bias
|
bool
|
Enable bias in parameter reconciliation. Default is False. |
False
|
with_batch_norm
|
bool
|
Include batch normalization in layers. Default is False. |
False
|
with_relu
|
bool
|
Include ReLU activation in layers. Default is True. |
True
|
with_softmax
|
bool
|
Include softmax activation in the output layer. Default is True. |
True
|
with_dropout
|
bool
|
Include dropout in layers. Default is False. |
False
|
p
|
float
|
Dropout probability. Default is 0.25. |
0.25
|
device
|
str
|
Device for computation ('cpu' or 'cuda'). Default is 'cpu'. |
'cpu'
|
*args
|
optional
|
Additional positional arguments for superclass. |
()
|
**kwargs
|
optional
|
Additional keyword arguments for superclass. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If |
Source code in tinybig/model/rpn_gcn.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|