# Contents
- [Contents](#contents)
- [DeepFM Description](#deepfm-description)
- [Model Architecture](#model-architecture)
- [Dataset](#dataset)
- [Environment Requirements](#environment-requirements)
- [Quick Start](#quick-start)
- [Script Description](#script-description)
- [Script and Sample Code](#script-and-sample-code)
- [Script Parameters](#script-parameters)
- [Training Process](#training-process)
- [Training](#training)
- [Distributed Training](#distributed-training)
- [Evaluation Process](#evaluation-process)
- [Evaluation](#evaluation)
- [Inference Process](#inference-process)
- [Export MindIR](#export-mindir)
- [Infer on Ascend310](#infer-on-ascend310)
- [result](#result)
- [Model Description](#model-description)
- [Performance](#performance)
- [Training Performance](#training-performance)
- [Inference Performance](#inference-performance)
- [Description of Random Situation](#description-of-random-situation)
- [ModelZoo Homepage](#modelzoo-homepage)
# [DeepFM Description](#contents)
Learning sophisticated feature interactions behind user behaviors is critical in maximizing CTR for recommender systems. Despite great progress, existing methods seem to have a strong bias towards low- or high-order interactions, or require expertise feature engineering. In this paper, we show that it is possible to derive an end-to-end learning model that emphasizes both low- and high-order feature interactions. The proposed model, DeepFM, combines the power of factorization machines for recommendation and deep learning for feature learning in a new neural network architecture.
[Paper](https://arxiv.org/abs/1703.04247): Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, Xiuqiang He. DeepFM: A Factorization-Machine based Neural Network for CTR Prediction
# [Model Architecture](#contents)
DeepFM consists of two components. The FM component is a factorization machine, which is proposed in to learn feature interactions for recommendation. The deep component is a feed-forward neural network, which is used to learn high-order feature interactions.
The FM and deep component share the same input raw feature vector, which enables DeepFM to learn low- and high-order feature interactions simultaneously from the input raw features.
# [Dataset](#contents)
- [1] A dataset used in Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, Xiuqiang He. DeepFM: A Factorization-Machine based Neural Network for CTR Prediction[J]. 2017.
# [Environment Requirements](#contents)
- Hardware(Ascend/GPU/CPU)
- Prepare hardware environment with Ascend, GPU, or CPU processor.
- Framework
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below:
- [MindSpore Tutorials](https://www.mindspore.cn/tutorials/en/master/index.html)
- [MindSpore Python API](https://www.mindspore.cn/docs/api/en/master/index.html)
# [Quick Start](#contents)
After installing MindSpore via the official website, you can start training and evaluation as follows:
- preprocess dataset
'''bash
#download dataset
#Please refer to [1] to obtain the download link
mkdir -p data/origin_data && cd data/origin_data
wget DATA_LINK
tar -zxvf dac.tar.gz
#preprocess dataset
python src/preprocess_data.py --data_path=./data/ --dense_dim=13 --slot_dim=26 --threshold=100 --train_line_count=45840617 --skip_id_convert=0
'''
- running on Ascend
```shell
# run training example
python train.py \
--dataset_path='dataset/train' \
--ckpt_path='./checkpoint' \
--eval_file_name='auc.log' \
--loss_file_name='loss.log' \
--device_target=Ascend \
--do_eval=True > ms_log/output.log 2>&1 &
# run distributed training example
bash scripts/run_distribute_train.sh 8 /dataset_path /rank_table_8p.json
# run evaluation example
python eval.py \
--dataset_path='dataset/test' \
--checkpoint_path='./checkpoint/deepfm.ckpt' \
--device_target=Ascend > ms_log/eval_output.log 2>&1 &
OR
bash scripts/run_eval.sh 0 Ascend /dataset_path /checkpoint_path/deepfm.ckpt
```
For distributed training, a hccl configuration file with JSON format needs to be created in advance.
Please follow the instructions in the link below:
[hccl tools](https://gitee.com/mindspore/models/tree/r1.5/utils/hccl_tools).
- running on GPU
```shell
# run training example
python train.py \
--dataset_path='dataset/train' \
--ckpt_path='./checkpoint' \
--eval_file_name='auc.log' \
--loss_file_name='loss.log' \
--device_target=GPU \
--do_eval=True > ms_log/output.log 2>&1 &
# run distributed training example
bash scripts/run_distribute_train_gpu.sh 8 /dataset_path
# run evaluation example
python eval.py \
--dataset_path='dataset/test' \
--checkpoint_path='./checkpoint/deepfm.ckpt' \
--device_target=GPU > ms_log/eval_output.log 2>&1 &
OR
bash scripts/run_eval.sh 0 GPU /dataset_path /checkpoint_path/deepfm.ckpt
```
- running on CPU
```shell
# run training example
python train.py \
--dataset_path='dataset/train' \
--ckpt_path='./checkpoint' \
--eval_file_name='auc.log' \
--loss_file_name='loss.log' \
--device_target=CPU \
--do_eval=True > ms_log/output.log 2>&1 &
# run evaluation example
python eval.py \
--dataset_path='dataset/test' \
--checkpoint_path='./checkpoint/deepfm.ckpt' \
--device_target=CPU > ms_log/eval_output.log 2>&1 &
```
- Running on [ModelArts](https://support.huaweicloud.com/modelarts/)
```bash
# Train 8p with Ascend
# (1) Perform a or b.
# a. Set "enable_modelarts=True" on default_config.yaml file.
# Set "distribute=True" on default_config.yaml file.
# Set "dataset_path='/cache/data'" on default_config.yaml file.
# Set "train_epochs: 5" on default_config.yaml file.
# (optional)Set "checkpoint_url='s3://dir_to_your_pretrained/'" on default_config.yaml file.
# Set other parameters on default_config.yaml file you need.
# b. Add "enable_modelarts=True" on the website UI interface.
# Add "distribute=True" on the website UI interface.
# Add "dataset_path=/cache/data" on the website UI interface.
# Add "train_epochs: 5" on the website UI interface.
# (optional)Add "checkpoint_url='s3://dir_to_your_pretrained/'" on the website UI interface.
# Add other parameters on the website UI interface.
# (2) Prepare model code
# (3) Upload or copy your pretrained model to S3 bucket if you want to finetune.
# (4) Perform a or b. (suggested option a)
# a. First, zip MindRecord dataset to one zip file.
# Second, upload your zip dataset to S3 bucket.(you could also upload the origin mindrecord dataset, but it can be so slow.)
# b. Upload the original dataset to S3 bucket.
# (Data set conversion occurs during training process and costs a lot of time. it happens every time you train.)
# (5) Set the code directory to "/path/deepfm" on the website UI interface.
# (6) Set the startup file to "train.py" on the website UI interface.
# (7) Set the "Dataset path" and "Output file path" and "Job log path" to your path on the website UI interface.
# (8) Create your job.
#
# Train 1p with Ascend
# (1) Perform a or b.
# a. Set "enable_modelarts=True" on default_config.yaml file.
# Set "dataset_path='/cache/data'" on default_config.yaml file.
# Set "train_epochs: 5" on default_config.yaml file.
# (optional)Set "checkpoint_url='s3://dir_to_your_pretrained/'" on default_config.yaml file.
# Set other parameters on default_config.yaml file you need.
# b. Add "enable_modelarts=True" on the website UI interface.
# Add "dataset_path='/cache
没有合适的资源?快使用搜索试试~ 我知道了~
南京理工大学机器学习与人工智能选修课程大作业备份.zip
共73个文件
py:37个
sh:18个
md:5个
需积分: 5 1 下载量 69 浏览量
2024-04-16
22:51:50
上传
评论
收藏 114KB ZIP 举报
温馨提示
众所周知,人工智能是当前最热门的话题之一, 计算机技术与互联网技术的快速发展更是将对人工智能的研究推向一个新的高潮。 人工智能是研究模拟和扩展人类智能的理论与方法及其应用的一门新兴技术科学。 作为人工智能核心研究领域之一的机器学习, 其研究动机是为了使计算机系统具有人的学习能力以实现人工智能。 那么, 什么是机器学习呢? 机器学习 (Machine Learning) 是对研究问题进行模型假设,利用计算机从训练数据中学习得到模型参数,并最终对数据进行预测和分析的一门学科。 机器学习的用途 机器学习是一种通用的数据处理技术,其包含了大量的学习算法。不同的学习算法在不同的行业及应用中能够表现出不同的性能和优势。目前,机器学习已成功地应用于下列领域: 互联网领域----语音识别、搜索引擎、语言翻译、垃圾邮件过滤、自然语言处理等 生物领域----基因序列分析、DNA 序列预测、蛋白质结构预测等 自动化领域----人脸识别、无人驾驶技术、图像处理、信号处理等 金融领域----证券市场分析、信用卡欺诈检测等 医学领域----疾病鉴别/诊断、流行病爆发预测等 刑侦领域----潜在犯罪识别与预测、模拟人工智能侦探等 新闻领域----新闻推荐系统等 游戏领域----游戏战略规划等 从上述所列举的应用可知,机器学习正在成为各行各业都会经常使用到的分析工具,尤其是在各领域数据量爆炸的今天,各行业都希望通过数据处理与分析手段,得到数据中有价值的信息,以便明确客户的需求和指引企业的发展。
资源推荐
资源详情
资源评论
收起资源包目录
南京理工大学机器学习与人工智能选修课程大作业备份.zip (73个子文件)
content
DeepFM
deepfm
README_CN.md 19KB
preprocess.py 2KB
eval.py 3KB
mindspore_hub_conf.py 1KB
ascend310_infer
inc
utils.h 1KB
CMakeLists.txt 668B
src
utils.cc 4KB
main.cc 5KB
build.sh 919B
src
__init__.py 658B
dataset.py 12KB
model_utils
__init__.py 0B
moxing_adapter.py 4KB
local_adapter.py 1KB
device_adapter.py 1021B
config.py 4KB
preprocess_data.py 12KB
deepfm.py 16KB
callback.py 4KB
export.py 2KB
default_config.yaml 3KB
requirements.txt 28B
postprocess.py 1KB
train.py 6KB
README.md 20KB
scripts
run_standalone_train.sh 1KB
run_distribute_train.sh 2KB
run_distribute_train_gpu.sh 1KB
run_eval.sh 1KB
run_infer_310.sh 4KB
LICENCE 1KB
readme.md 353B
KNN
wine.data 11KB
KNN_main.py 3KB
requirements.txt 71B
.gitignore 249B
Linear_Regression
LineReg_main.py 2KB
Logistic_Regression
iris.data 4KB
LogiReg_main.py 3KB
Wide_and_Deep
README_CN.md 15KB
train_and_eval_distribute.py 5KB
eval.py 4KB
mindspore_hub_conf.py 1KB
train_and_eval_parameter_server_distribute.py 7KB
src
wide_and_deep.py 21KB
__init__.py 0B
metrics.py 2KB
generate_synthetic_data.py 5KB
datasets.py 15KB
preprocess_data.py 13KB
callbacks.py 5KB
process_data.py 11KB
config.py 6KB
export.py 2KB
train_and_eval_parameter_server_standalone.py 5KB
train_and_eval.py 4KB
requirements.txt 21B
script
run_auto_parallel_train.sh 1KB
run_multigpu_train.sh 1KB
run_auto_parallel_train_cluster.sh 2KB
run_multinpu_train.sh 1KB
run_parameter_server_train_distribute.sh 3KB
common.sh 3KB
run_parameter_server_train_cluster.sh 4KB
run_parameter_server_train_standalone.sh 3KB
cluster_32p.json 300B
run_standalone_train_for_gpu.sh 1KB
run_multigpu_train_host_device.sh 1KB
deploy_cluster.sh 1KB
start_cluster.sh 2KB
train.py 3KB
README.md 16KB
train_and_eval_auto_parallel.py 6KB
共 73 条
- 1
资源评论
生瓜蛋子
- 粉丝: 3556
- 资源: 2815
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
- 基于MIC+NE555光敏电阻的声光控电路Multisim仿真原理图
- 基于JSP毕业设计-基于WEB操作系统课程教学网站的设计与实现(源代码+论文).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功