libcity.model.trajectory_loc_prediction.FPMC

class libcity.model.trajectory_loc_prediction.FPMC.FPMC(config, data_feature)[source]

Bases: libcity.model.abstract_model.AbstractModel

FPMC 作为序列推荐任务中的比较经典的模型,也可以适用于下一跳预测任务 Reference: https://github.com/RUCAIBox/RecBole/blob/master/recbole/model/sequential_recommender/fpmc.py https://github.com/khesui/FPMC

calculate_loss(batch)[source]
Parameters

batch (Batch) – a batch of input

Returns

return training loss

Return type

torch.tensor

forward(batch)[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.

predict(batch)[source]
Parameters

batch (Batch) – a batch of input

Returns

predict result of this batch

Return type

torch.tensor

training: bool