!8835 [ModelZoo]Fix bgcf config error

From: @zhan_ke
Reviewed-by: @yingjy,@oacjiewen
Signed-off-by: @yingjy
This commit is contained in:
mindspore-ci-bot 2020-11-23 09:08:50 +08:00 committed by Gitee
commit 67bdad39ed
2 changed files with 16 additions and 12 deletions

View File

@ -132,7 +132,6 @@ Parameters for both training and evaluation can be set in config.py.
"input_dim": 64, # User and item embedding dimension "input_dim": 64, # User and item embedding dimension
"l2": 0.03 # l2 coefficient "l2": 0.03 # l2 coefficient
"neighbor_dropout": [0.0, 0.2, 0.3]# Dropout ratio for different aggregation layer "neighbor_dropout": [0.0, 0.2, 0.3]# Dropout ratio for different aggregation layer
"num_graphs":5 # Num of sample graph
``` ```
config.py for more configuration. config.py for more configuration.
@ -193,21 +192,32 @@ Parameters for both training and evaluation can be set in config.py.
``` ```
# [Model Description](#contents) # [Model Description](#contents)
## [Performance](#contents) ## [Performance](#contents)
### Evaluation Performance
| Parameter | BGCF | | Parameter | BGCF |
| ------------------------------------ | ----------------------------------------- | | ------------------------------------ | ----------------------------------------- |
| Model Version | Inception V1 |
| Resource | Ascend 910 | | Resource | Ascend 910 |
| uploaded Date | 09/23/2020(month/day/year) | | uploaded Date | 09/23/2020(month/day/year) |
| MindSpore Version | 1.0.0 | | MindSpore Version | 1.0.0 |
| Dataset | Amazon-Beauty | | Dataset | Amazon-Beauty |
| Training Parameter | epoch=600 | | Training Parameter | epoch=600,steps=12,batch_size=5000,lr=0.001 |
| Optimizer | Adam | | Optimizer | Adam |
| Loss Function | BPR loss | | Loss Function | BPR loss |
| Recall@20 | 0.1534 |
| NDCG@20 | 0.0912 |
| Training Cost | 25min | | Training Cost | 25min |
| Scripts | [bgcf script](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/gnn/bgcf) | | Scripts | [bgcf script](https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/gnn/bgcf) |
### Inference Performance
| Parameter | BGCF |
| ------------------------------------ | ----------------------------------------- |
| Model Version | Inception V1 |
| Resource | Ascend 910 |
| uploaded Date | 09/23/2020(month/day/year) |
| MindSpore Version | 1.0.0 |
| Dataset | Amazon-Beauty |
| Batch_size | 5000 |
| Output | probability |
| Recall@20 | 0.1534 |
| NDCG@20 | 0.0912 |
# [Description of random situation](#contents) # [Description of random situation](#contents)
BGCF model contains lots of dropout operations, if you want to disable dropout, set the neighbor_dropout to [0.0, 0.0, 0.0] in src/config.py. BGCF model contains lots of dropout operations, if you want to disable dropout, set the neighbor_dropout to [0.0, 0.0, 0.0] in src/config.py.

View File

@ -24,16 +24,13 @@ def parser_args():
parser.add_argument("-d", "--dataset", type=str, default="Beauty", help="choose which dataset") parser.add_argument("-d", "--dataset", type=str, default="Beauty", help="choose which dataset")
parser.add_argument("-dpath", "--datapath", type=str, default="./scripts/data_mr", help="minddata path") parser.add_argument("-dpath", "--datapath", type=str, default="./scripts/data_mr", help="minddata path")
parser.add_argument("-de", "--device", type=str, default='0', help="device id") parser.add_argument("-de", "--device", type=str, default='0', help="device id")
parser.add_argument('--seed', type=int, default=0, help="random seed")
parser.add_argument('--Ks', type=list, default=[5, 10, 20, 100], help="top K") parser.add_argument('--Ks', type=list, default=[5, 10, 20, 100], help="top K")
parser.add_argument('--test_ratio', type=float, default=0.2, help="test ratio") parser.add_argument('-w', '--workers', type=int, default=8, help="number of process to generate data")
parser.add_argument('-w', '--workers', type=int, default=8, help="number of process")
parser.add_argument("-ckpt", "--ckptpath", type=str, default="./ckpts", help="checkpoint path") parser.add_argument("-ckpt", "--ckptpath", type=str, default="./ckpts", help="checkpoint path")
parser.add_argument("-eps", "--epsilon", type=float, default=1e-8, help="optimizer parameter") parser.add_argument("-eps", "--epsilon", type=float, default=1e-8, help="optimizer parameter")
parser.add_argument("-lr", "--learning_rate", type=float, default=1e-3, help="learning rate") parser.add_argument("-lr", "--learning_rate", type=float, default=1e-3, help="learning rate")
parser.add_argument("-l2", "--l2", type=float, default=0.03, help="l2 coefficient") parser.add_argument("-l2", "--l2", type=float, default=0.03, help="l2 coefficient")
parser.add_argument("-wd", "--weight_decay", type=float, default=0.01, help="weight decay")
parser.add_argument("-act", "--activation", type=str, default='tanh', choices=['relu', 'tanh'], parser.add_argument("-act", "--activation", type=str, default='tanh', choices=['relu', 'tanh'],
help="activation function") help="activation function")
parser.add_argument("-ndrop", "--neighbor_dropout", type=list, default=[0.0, 0.2, 0.3], parser.add_argument("-ndrop", "--neighbor_dropout", type=list, default=[0.0, 0.2, 0.3],
@ -52,7 +49,4 @@ def parser_args():
parser.add_argument("-emb", "--embedded_dimension", type=int, default=64, help="output embedding dim") parser.add_argument("-emb", "--embedded_dimension", type=int, default=64, help="output embedding dim")
parser.add_argument('--dist_reg', type=float, default=0.003, help="distance loss coefficient") parser.add_argument('--dist_reg', type=float, default=0.003, help="distance loss coefficient")
parser.add_argument('-ng', '--num_graphs', type=int, default=5, help="num of sample graph")
parser.add_argument('-geps', '--graph_epsilon', type=float, default=0.01, help="node copy parameter")
return parser.parse_args() return parser.parse_args()