{"id":19733988,"url":"https://github.com/scaleoutsystems/fedn-client-imdb-keras","last_synced_at":"2025-02-27T20:53:37.571Z","repository":{"id":49161471,"uuid":"339729087","full_name":"scaleoutsystems/FEDn-client-imdb-keras","owner":"scaleoutsystems","description":"FEDn client for  federated sentiment analysis ","archived":false,"fork":false,"pushed_at":"2021-09-02T14:41:11.000Z","size":17301,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-10T18:23:50.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scaleoutsystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-17T13:15:48.000Z","updated_at":"2021-04-08T20:53:28.000Z","dependencies_parsed_at":"2022-09-09T08:51:58.969Z","dependency_job_id":null,"html_url":"https://github.com/scaleoutsystems/FEDn-client-imdb-keras","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-imdb-keras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-imdb-keras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-imdb-keras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-imdb-keras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaleoutsystems","download_url":"https://codeload.github.com/scaleoutsystems/FEDn-client-imdb-keras/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241059017,"owners_count":19902296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T00:34:52.528Z","updated_at":"2025-02-27T20:53:37.552Z","avatar_url":"https://github.com/scaleoutsystems.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLP- IMDB test project\nThis classic example of sentiment analysis is well suited both as a lightweight test when learning FEDn and developing on FEDn in psedo-distributed mode. A normal high-end laptop or a workstation should be able to sustain at least 5 clients. The example is also useful for general scalability tests in fully distributed mode. \n\n\n## Configure and start a client using cpu device\nThe easiest way to start clients for quick testing is to use shell script.The following \nshell script will configure and start a client on a blank Ubuntu 20.04 LTS VM:    \n\n\n```bash\n#!/bin/bash\n\n# Install Docker and docker-compose\nsudo apt-get update\nsudo sudo snap install docker\n\n# clone the nlp_imdb example\ngit clone https://github.com/aitmlouk/FEDn-client-imdb-keras.git\ncd FEDn-client-imdb-keras\n\n# if no available data, download it from archive\n# wget https://archive.org/download/data_20210128/data.zip\n# sudo apt install unzip\n# unzip data.zip\n# sudo rm data.zip\n\n# Make sure you have edited extra-hosts.yaml to provide hostname mappings for combiners\n# Make sure you have edited fedn-network.yaml to provide hostname mappings for reducer\nsudo docker-compose -f docker-compose.10clients.yaml -f extra-hosts.yaml up --build\n```\n\n### Start prediction- global model serving\nWe have made it possible to use the trained global model for prediction, to start the UI make sure that the FEDn-network is\nis started and run the flask app (python predict/app.py)\n```bash\n# prediction/\npython app.py\n```\n\n### Configuring the tests\nWe have made it possible to configure a couple of settings to vary the conditions for the training. These configurations are expsosed in the file 'client/settings.yaml': \n\n```yaml \n# Parameters for local training\ntest_size: 0.25\nbatch_size: 32\nepochs: 1\n```\n\n### Creating a compute package\nTo train a model in FEDn you provide the client code (in 'client') as a tarball. For convenience, we ship a pre-made package (nlp_imdb.tar.gz). Whenever you make updates to the client code (such as altering any of the settings in the above mentioned file), you need to re-package the code (as a .tar.gz archive) and copy the updated package to 'packages'.\n\n```bash\ntar -cf nlp_imdb.tar client\ngzip nlp_imdb.tar\ncp nlp_imdb.tar.gz packages/\n```\n\n## Creating a seed model\nThe baseline CNN-LSTM is specified in the file 'client/init_model.py'. This script creates an untrained neural network and serialized that to a file, which is uploaded as the seed model for federated training. For convenience we ship a pregenerated seed model in the 'seed/' directory. If you wish to alter the base model, edit 'client/models/imdb_model.py' and regenerate the seed file:\n```bash\n# client/models\npython init_model.py \n```\n\n## License\nApache-2.0 (see LICENSE file for full information).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleoutsystems%2Ffedn-client-imdb-keras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaleoutsystems%2Ffedn-client-imdb-keras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleoutsystems%2Ffedn-client-imdb-keras/lists"}