Giter VIP home page Giter VIP logo

amanpriyanshu / federated-recommendation-neural-collaborative-filtering Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 4.0 137.82 MB

Federated Neural Collaborative Filtering (FedNCF). Neural Collaborative Filtering utilizes the flexibility, complexity, and non-linearity of Neural Network to build a recommender system. Aim to federate this recommendation system.

License: MIT License

Python 100.00%
federated-learning neural-network recommender-system distributed-learning federated iid movie-recommendation ncf neural-collaborative-filtering non-iid

federated-recommendation-neural-collaborative-filtering's Introduction

Federated-Neural-Collaborative-Filtering

Neural Collaborative Filtering (NCF) is a paper published by National University of Singapore, Columbia University, Shandong University, and Texas A&M University in 2017. It utilizes the flexibility, complexity, and non-linearity of Neural Network to build a recommender system.

Aim to federated this!

Demo

demo

Setting:

Each client contains a group of users, in the real world this could be considered as connecting from the same WiFi. They learn a local model for recommendation, which is then aggregated centrally.

Metrics:

  1. Hit Ratio: is the fraction of users for which the correct answer is included in the recommendation list of length N, here N=10.
  2. NDCG: is a metric of ranking quality or the relevance of the top N listed products, here N=10.

Execution:

Run the Central Single Client Model

Using the command: python train_single.py

dataloader = MovielensDatasetLoader()
trainer = NCFTrainer(dataloader.ratings[:50], epochs=20, batch_size=128)
ncf_optimizer = torch.optim.Adam(trainer.ncf.parameters(), lr=5e-4)
_, progress = trainer.train(ncf_optimizer, return_progress=True)

Run the Federated Aggregator Multi-Client Model

Using the command: python train_federated.py

dataloader = MovielensDatasetLoader()
fncf = FederatedNCF(dataloader.ratings, num_clients=50, user_per_client_range=[1, 10], mode="ncf", aggregation_epochs=50, local_epochs=10, batch_size=128)
fncf.train()

federated-recommendation-neural-collaborative-filtering's People

Contributors

amanpriyanshu 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

Watchers

 avatar  avatar

federated-recommendation-neural-collaborative-filtering's Issues

Test dataset

Hello, it appears that the dataset has not been partitioned into training and testing sets, hasn't it?

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.