libcity.model.road_representation.GeomGCN¶
-
class
libcity.model.road_representation.GeomGCN.
GeomGCN
(config, data_feature)[source]¶ Bases:
libcity.model.abstract_traffic_state_model.AbstractTrafficStateModel
-
calculate_loss
(batch)[source]¶ - Parameters
batch – dict, need key ‘node_features’, ‘node_labels’, ‘mask’
Returns:
-
forward
(batch)[source]¶ 自回归任务
- Parameters
batch – dict, need key ‘node_features’ contains tensor shape=(N, feature_dim)
- Returns
N, output_classes
- Return type
torch.tensor
-
training
: bool¶
-
-
class
libcity.model.road_representation.GeomGCN.
GeomGCNNet
(g, in_feats, out_feats, num_divisions, activation, num_heads, dropout_prob, ggcn_merge, channel_merge, device)[source]¶ Bases:
torch.nn.modules.module.Module
-
forward
(feature)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training
: bool¶
-
-
class
libcity.model.road_representation.GeomGCN.
GeomGCNSingleChannel
(g, in_feats, out_feats, num_divisions, activation, dropout_prob, merge, device)[source]¶ Bases:
torch.nn.modules.module.Module
-
forward
(feature)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training
: bool¶
-