1 主调用
python run_model.py --task traj_loc_pred --model DeepMove --dataset gowalla --batch_size=5
- 有task、dataset、model三个必须命令行参数
- batch_size一个可选命令行参数
- 没有confg_file

1.1 libcity/utils/argument_list.py/str2bool

- 将字符串表示的布尔值转换为 Python 中的布尔值。
-
首先检查输入的参数是否已经是布尔值类型,如果是,则直接返回该值,无需转换。
-
if s.lower() in ('yes', 'true')::检查字符串是否是'yes'或'true',如果是,则返回True。 -
elif s.lower() in ('no', 'false')::检查字符串是否是'no'或'false',如果是,则返回False。 -
else::如果字符串既不是'yes'/'true'也不是'no'/'false',则抛出argparse.ArgumentTypeError异常,表示期望一个布尔值。
-
1.2 libcity/utils/argument_list.py/add_general_args

2 libcity/pipeline/pipeline.py/run_model

2.1 libcity/config/config_parser.py/ConfigParser
2.1.1 构造函数
2.1.2 get
2.2 libcity/utils/utils.py/get_logger
2.3 set_random_seed
2.4 get_data &get_data_feature
Libcity笔记:libcity/data/dataset/trajectory_encoder/standard_trajectory_encoder.py-CSDN博客
2.5 get_model
从ibcity/model/trajectory_loc_prediction/DeepMove.py 中生成 DeepMove类
2.5.1 get_evaluator
2.6 traiin