Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
4 years ago | |
|---|---|---|
| .. | ||
| ascend310_infer | 4 years ago | |
| script | 4 years ago | |
| src | 4 years ago | |
| README.md | 4 years ago | |
| eval.py | 4 years ago | |
| export.py | 4 years ago | |
| postprocess.py | 4 years ago | |
| train.py | 4 years ago | |
NAML is a multi-view news recommendation approach. The core of NAML is a news encoder and a user encoder. The newsencoder is composed of a title encoder, a abstract encoder, a category encoder and a subcategory encoder. In the user encoder, we learn representations of users from their browsed news. Besides, we apply additive attention to learn more informative news and user representations by selecting important words and news.
Paper Chuhan Wu, Fangzhao Wu, Mingxiao An, Jianqiang Huang, Yongfeng Huang and Xing Xie: Neural News Recommendation with Attentive Multi-View Learning, IJCAI 2019
Dataset used: MIND
MIND contains about 160k English news articles and more than 15 million impression logs generated by 1 million users.
You can download the dataset and put the directory in structure as follows:
└─MINDlarge
├─MINDlarge_train
├─MINDlarge_dev
└─MINDlarge_utils
├── naml
├── README.md # descriptions about NAML
├── scripts
│ ├──run_train.sh # shell script for training
│ ├──run_eval.sh # shell script for evaluation
│ ├──run_infer_310.sh # shell script for 310 inference
├── src
│ ├──option.py # parse args
│ ├──callback.py # callback file
│ ├──dataset.py # creating dataset
│ ├──naml.py # NAML architecture
│ ├──config.py # config file
│ ├──utils.py # utils to load ckpt_file for fine tune or incremental learn
├──ascend310_infer #application for 310 inference
├── train.py # training script
├── eval.py # evaluation script
├── export.py # export mindir script
└──postprogress.py # post process for 310 inference
You can start training using python or shell scripts. The usage of shell scripts as follows:
# train standalone
bash run_train.sh [PLATFORM] [DEVICE_ID] [DATASET] [DATASET_PATH]
# train distribute
bash run_distribute_train.sh [PLATFORM] [DEVICE_NUM] [DATASET] [DATASET_PATH] [RANK_TABLE_FILE]
# evaluation
bash run_eval.sh [PLATFORM] [DEVICE_ID] [DATASET] [DATASET_PATH] [CHECKPOINT_PATH]
PLATFORM should be Ascend.DEVICE_ID is the device id you want to run the network.DATASET MIND dataset, support large, small and demo.DATASET_PATH is the dataset path, the structure as Dataset.CHECKPOINT_PATH is a pre-trained checkpoint path.RANK_TABLE_FILE is HCCL configuration file when running on Ascend.python export.py --platform [PLATFORM] --checkpoint_path [CHECKPOINT_PATH] --file_format [EXPORT_FORMAT] --batch_size [BATCH_SIZE]
EXPORT_FORMAT should be in ["AIR", "MINDIR"]| Parameters | Ascend |
|---|---|
| Model Version | NAML |
| Resource | Ascend 910; CPU 2.60GHz, 56cores; Memory 314G; OS Euler2.8 |
| uploaded Date | 02/23/2021 (month/day/year) |
| MindSpore Version | 1.2.0 |
| Dataset | MINDlarge |
| Training Parameters | epoch=1, steps=52869, batch_size=64, lr=0.001 |
| Optimizer | Adam |
| Loss Function | Softmax Cross Entropy |
| outputs | probability |
| Speed | 1pc: 62 ms/step |
| Total time | 1pc: 54 mins |
| Parameters | Ascend |
|---|---|
| Model Version | NAML |
| Resource | Ascend 910; OS Euler2.8 |
| Uploaded Date | 02/23/2021 (month/day/year) |
| MindSpore Version | 1.2.0 |
| Dataset | MINDlarge |
| batch_size | 64 |
| outputs | probability |
| Accuracy | AUC: 0.66 |
| Parameters | Ascend |
|---|---|
| Model Version | NAML |
| Resource | Ascend 310 |
| Uploaded Date | 03/13/2021 (month/day/year) |
| MindSpore Version | 1.2.0 |
| Dataset | MINDlarge |
| batch_size | 64 |
| outputs | probability |
| Accuracy | AUC: 0.667 |
In train.py, we set the seed which is used by numpy.random, mindspore.common.Initializer, mindspore.ops.composite.random_ops and mindspore.nn.probability.distribution.
Please check the official homepage.
MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
C++ Python Text Unity3D Asset C other