GithubHelp home page GithubHelp logo

Comments (2)

adam-narozniak avatar adam-narozniak commented on June 11, 2024

Hi @jmsw4bn. Thanks for pointing it out and figuring out the fix. I've opened the PR that fixes it.
As for the expected results [0.2, 0.2, 0.2, 0.94] won't be possible since the values sum up to more than 1. An error will be raised in that case. It might be confusing what should the 0.94 come from (it would have to overlap with some other parts that are expected to be separate). Alternatively, I think you might have meant 0.02, ... then it'd sum up to 1 and everything would work ok.

from flower.

jmsw4bn avatar jmsw4bn commented on June 11, 2024

Hi @jmsw4bn. Thanks for pointing it out and figuring out the fix. I've opened the PR that fixes it. As for the expected results [0.2, 0.2, 0.2, 0.94] won't be possible since the values sum up to more than 1. An error will be raised in that case. It might be confusing what should the 0.94 come from (it would have to overlap with some other parts that are expected to be separate). Alternatively, I think you might have meant 0.02, ... then it'd sum up to 1 and everything would work ok.

I am sorry, I wrote the wrong values.
Actually, I test the code is with "division=[0.02, 0.02, 0.02, 0.02, 0.92]".
These values sum up to 1, and the 3rd and 4th sub_datasets have 0 samples,
you can validate the error by debuging the following codes, and the output shows the 5 sub_datasets in "partition" have 1000 1000 0 0 40000 samples respectively (the right output should be 1000 1000 1000 1000 46000):

from flwr_datasets import FederatedDataset
from flwr_datasets.utils import divide_dataset
fds = FederatedDataset(dataset="cifar10", partitioners={"train": 1})
tds = fds.load_partition(0, "train")
partition = divide_dataset(dataset=tds, division=[0.02, 0.02, 0.02, 0.02, 0.92])
print(len(partition[0]), len(partition[1]), len(partition[2]), len(partition[3]), len(partition[4]))

from flower.

Related Issues (20)

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.