Giter Site home page Giter Site logo

sml's Introduction

SML

This is an implementation for our SIGIR 2020 paper: How to Retrain Recommender System? A Sequential Meta-Learning Method.

Contributors: Yang Zhang, Chenxu Wang, Fuli Feng, Xiangnan He

Requirements

pytorch >= 1.2

numpy

Parameters

  • --MF_lr: learning rate for $\hat(w)_t$
  • --TR_lr: learning rate for Transfer
  • --l2: $\lambda_1$ in paper
  • --TR_l2: $\lambda_2$ in paper
  • --MF_epochs: epochs of learning MF $\hat(w)_t$ (line 6 in Alg 1 in paper)
  • --TR_epochs: epochs of learning Transfer $\theta$ (line 9 in Alg 1 in paper)
  • --multi_num: stop condition (line 4 in Alg 1 in paper)
  • others: read help, or "python main_yelp.py --help"

Dataset

Save as array,

Examples

Yelp

nohup python main_yelp.py --MF_epochs=1 --TR_epochs=1 --multi_num=10 > yelp_log.out &

or

python main_yelp.py --MF_epochs=1 --TR_epochs=1 --multi_num=10

Adressa

nohup python main_news.py --MF_epochs=2 --TR_epochs=2 --multi_num=7 > yelp_log.out &

for Adressa, if we set the MF_epochs and TR_epochs same to paper (=1) , we can also get a similar performance if we adjust multi_num.

sml's People

Contributors

dingseewhole avatar wang975679801 avatar zyang1580 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sml's Issues

About the meta learner

It's really a fantastic work!! I‘m new to meta learning,and I have spend lots of time to understand meta learning these days, but I didn't figure out which kind of meta learning this work belongs to?Feed-Forword Model?Black-Box?or which work before give this spike to you?look forward to you reply

Create neg_item from input dataset

SML/data/dataset2.py

Lines 172 to 201 in 2e1e3ee

class trainDataset_withPreSample(Dataset):
'''
this is Dataset type for train transfer, the input dataset has sampled enough
neg item. the each epoch, will select on cloumn neg_item as neg item
'''
def __init__(self,input_dataset):
super(trainDataset_withPreSample, self).__init__()
self.all_data = copy.deepcopy(input_dataset)
self.have_read = 0
self.neg_flag = np.arange(1, self.all_data.shape[1])
np.random.shuffle(self.neg_flag)
self.neg_all = input_dataset.shape[1]-2
self.used_neg_count = 0
self.data_len = input_dataset.shape[0]
def __len__(self):
return self.all_data.shape[0]
def __getitem__(self, idx):
user = self.all_data[idx,0]
item = self.all_data[idx,1]
neg_item = self.all_data[idx,self.neg_flag[self.used_neg_count]]
self.have_read += 1
if self.have_read >= self.data_len:
self.have_read = 0
self.used_neg_count += 1
if self.used_neg_count >= self.neg_all:
np.random.shuffle(self.neg_flag)
self.used_neg_count = 0
return user,item,neg_item

Hi, thank you for your contribution. I have a question regarding the way you generate neg_item from input dataset. As for what I understand from readme and your code comments, the raw input dataset is of the format (user_id, pos_item_id, neg_item_id_1, neg_item_id_2 ... neg_item_id_n), hence the neg_item_id starts from third column. However, the self.neg_flag defined in the above class starts from 1, which is the second column. Can you help explain your code here? Please feel free to correct me if I'm wrong.

Thank you!

About Adressa Dataset

Thanks for all your hard work!
May I have a chance to know that do we have Adressa (news) dataset? We haven't seen it in the netdisk.

About the user and item amount of Yelp

I found that in your paper, the user and item of Yelp is 59082, 122816, respectively. However, in your code, there are 122816 users and 59082 items, and in the .npy files, users are encoded in [0,122815], while items are encoded in [0,59081]. May I ask is the number in the paper reversed? Or the user and item has put reversely in your code?

About dataset

information = np.load(self.path+self.dataname+'/'+"information.npy")

Hi, Thanks for your contributions~ and i have some questions about dataset and algorithm in your papers.

  1. dataset of yelp is in JSON format, and seems different from your data format. Can you provide your pre-process code or some sampe-examples?
  2. In algorithm2, why the \hat(W_t) is updated twice with D_t ? which has been updated in algorithm1 with D_t.

Thanks.

About Pre-train model in save_model

May I ask about another issue? I wonder how you pre-trained the model, and I can't find any information about it in the paper.
What I've done is that I used the most effective full-retrain model (after tuning the hyperparameters) as the pretrained one (baseline_init), for training fine-tune method, the recall@20 will be much higher than that proposed in the paper, which was 0.86 or higher.
If I used gowalla dataset, it will reach to 0.95, which is very incredible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.