Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIEN使用自定义config存在bug,初步确定在creat_dataset中 #2089

Open
zh-biabu opened this issue Sep 25, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@zh-biabu
Copy link

from logging import getLogger
from recbole.config import Config
from recbole.data import create_dataset, data_preparation
from recbole.model.sequential_recommender import DIEN
from recbole.trainer import Trainer
from recbole.utils import init_seed, init_logger

if name == 'main':

# configurations initialization
config = Config(model='DIEN', dataset='ml-100k',config_file_list=["/kaggle/input/config-dien/DIEN.yaml"],config_dict=args)

init_seed(config['seed'], config['reproducibility'])

init_logger(config)
logger = getLogger()

logger.info(config)

dataset = create_dataset(config)
logger.info(dataset)

config["eval_args"]
#{'split': {'LS': 'valid_and_test'},

'order': 'TO',

#'group_by': 'user',
#'mode': {'valid': 'full', 'test': 'full'}}
dataset.config["eval_args"]
#{'split': {'RS': [0.8, 0.1, 0.1]},

'order': 'RO',

'group_by': 'user',

#'mode': {'valid': 'full', 'test': 'full'}}
#原config的结果与dataset中config的结果不同,这导致在后续的train_data, valid_data, test_data = data_preparation(config, dataset)语#句中出现bug
#The ordering args for sequential recommendation has to be 'TO'
#同理在使用api快速启动模块时也出现了这个报错
#下面是我的配置文件内容
gpu_id: "0,1"
seed: 1234
encoding: 'utf-8'
data_path: /kaggle/input
show_progress: False
save_dataset: True
#数据
field_separator: "\t"
seq_separator: " "
USER_ID_FIELD: user_id
ITEM_ID_FIELD: item_id
RATING_FIELD: rating
TIME_FIELD: timestamp
seq_len: None
LABEL_FIELD: label
MAX_ITEM_LIST_LENGTH: 50
load_col:
inter: [user_id, item_id,rating, timestamp]
item: [item_id,release_year,class]
user: [user_id,age,gender,occupation,zip_code]
#训练
epochs: 100
train_batch_size: 1024
learner: 'sgd'
learning_rate: 0.01
train_neg_sample_args:
distribution: popularity
sample_num: 10
eval_step: 1
weight_decay: 1
#评估
eval_args:
split: {'LS': 'valid_and_test'}
mode: full
order: TO
repeatable: True
metrics: ['Recall', 'MRR', 'NDCG', 'Hit', 'Precision']
topk: 10
valid_metric: 'MRR@10'
eval_batch_size: 1024
#模型
alpha: 0.8
dropout_prob: 0.3

@zh-biabu zh-biabu added the bug Something isn't working label Sep 25, 2024
@TayTroye
Copy link
Collaborator

@zh-biabu
你好,我使用你的配置文件并没有出现冲突报错,序列模型的建模需要设置 order:To

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants