libcity.model.traffic_flow_prediction.AGCRN¶
-
class
libcity.model.traffic_flow_prediction.AGCRN.AGCRN(config, data_feature)[源代码]¶ 基类:
libcity.model.abstract_traffic_state_model.AbstractTrafficStateModel-
calculate_loss(batch)[源代码]¶ 输入一个batch的数据,返回训练过程的loss,也就是需要定义一个loss函数
- 参数
batch (Batch) – a batch of input
- 返回
return training loss
- 返回类型
torch.tensor
-
forward(batch)[源代码]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
注解
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
predict(batch)[源代码]¶ 输入一个batch的数据,返回对应的预测值,一般应该是**多步预测**的结果,一般会调用nn.Moudle的forward()方法
- 参数
batch (Batch) – a batch of input
- 返回
predict result of this batch
- 返回类型
torch.tensor
-
training: bool¶
-
-
class
libcity.model.traffic_flow_prediction.AGCRN.AGCRNCell(node_num, dim_in, dim_out, cheb_k, embed_dim)[源代码]¶ 基类:
torch.nn.modules.module.Module-
forward(x, state, node_embeddings)[源代码]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
注解
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance 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.traffic_flow_prediction.AGCRN.AVWDCRNN(config)[源代码]¶ 基类:
torch.nn.modules.module.Module-
forward(x, init_state, node_embeddings)[源代码]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
注解
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance 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.traffic_flow_prediction.AGCRN.AVWGCN(dim_in, dim_out, cheb_k, embed_dim)[源代码]¶ 基类:
torch.nn.modules.module.Module-
forward(x, node_embeddings)[源代码]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
注解
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training: bool¶
-