Coder Social home page Coder Social logo

krdn's Introduction

KRDN

Source code for Knowledge-refined Denoising Network for Robust Recommendation

Environment Requirements

  • Ubuntu OS
  • Python >= 3.8 (Anaconda3 is recommended)
  • PyTorch 1.7+
  • A Nvidia GPU with cuda 11.1+

Datasets

We use three processed datasets: Alibaba-iFashion, Yelp2018 and Last-FM.

Training

  • Alibaba-iFashion dataset
python main.py --dataset alibaba-ifashion --lr 0.0001 --context_hops 3 --num_neg_sample 200 --margin 0.6 --max_iter 2
  • Yelp2018 dataset
python main.py --dataset yelp2018 --lr 0.0001 --context_hops 2 --num_neg_sample 400 --margin 0.8 --max_iter 1
  • Last-FM dataset
python main.py --dataset last-fm --lr 0.0001 --context_hops 2 --num_neg_sample 400 --margin 0.7 --max_iter 2

krdn's People

Contributors

xj-zhu98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

krdn's Issues

关于KRDN的公式4和公式2的代码实现

作者您好,感谢您的团队提供的KRDN代码!现在有一个问题想请教:在下载的代码中,我认为class Aggregator的KG_forward方法实现的是论文中的公式4,不知是否正确?
但是在KG_forward我未能找到公式4中的m(h,t),也就是在公式2中定义的符合伯努利分布的m(i)。

希望得到您的解答与纠正,谢谢!

Something went wrong...

@xj-zhu98
`The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "main.py", line 106, in
all_feed_data = get_feed_data(train_cf_pairs, user_dict['train_user_set']) # {'user': [n,], 'pos_item': [n,], 'neg_item': [n, n_sample]}
File "main.py", line 54, in get_feed_data
feed_dict['neg_items'] = torch.LongTensor(negative_sampling(entity_pairs,train_user_set))
File "main.py", line 46, in negative_sampling
neg_items = pool.map(get_neg_one, user_item.cpu().numpy()[:, 0])
File "Anaconda3\pytorch\lib\multiprocessing\pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "Anaconda3\pytorch\lib\multiprocessing\pool.py", line 771, in get
raise self._value
ValueError: high <= 0

进程已结束,退出代码为 1
`

代码爆显存

RuntimeError: CUDA out of memory. Tried to allocate 170.00 MiB (GPU 0; 23.70 GiB total capacity; 21.01 GiB already allocated; 136.56 MiB free; 21.41 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF感觉是够的运行就会报这个错误

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.