Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Flower Datasets (flwr-datasets
) is a library to quickly and easily create datasets for federated learning, federated evaluation, and federated analytics. It was created by the Flower Labs
team that also created Flower: A Friendly Federated AI Framework.
[!TIP] For complete documentation that includes API docs, how-to guides and tutorials, please visit the Flower Datasets Documentation and for full FL example see the Flower Examples page.
For a complete installation guide visit the Flower Datasets Documentation
pip install flwr-datasets[vision]
Flower Datasets library supports:
datasets
,Thanks to using Hugging Face's datasets
used under the hood, Flower Datasets integrates with the following popular formats/frameworks:
Create custom partitioning schemes or choose from the implemented partitioning schemes:
Partitioner
IidPartitioner(num_partitions)
DirichletPartitioner(num_partitions, partition_by, alpha)
DistributionPartitioner(distribution_array, num_partitions, num_unique_labels_per_partition, partition_by, preassigned_num_samples_per_label, rescale)
InnerDirichletPartitioner(partition_sizes, partition_by, alpha)
PathologicalPartitioner(num_partitions, partition_by, num_classes_per_partition, class_assignment_mode)
NaturalIdPartitioner(partition_by)
SizePartitioner
LinearPartitioner(num_partitions)
SquarePartitioner(num_partitions)
ExponentialPartitioner(num_partitions)
Comparison of Partitioning Schemes on CIFAR10
PS: This plot was generated using a library function (see flwr_datasets.visualization package for more).
Flower Datasets exposes the FederatedDataset
abstraction to represent the dataset needed for federated learning/evaluation/analytics. It has two powerful methods that let you handle the dataset preprocessing: load_partition(partition_id, split)
and load_split(split)
.
Here's a basic quickstart example of how to partition the MNIST dataset:
from flwr_datasets import FederatedDataset
from flwr_datasets.partitioners import IidPartitioner
# The train split of the MNIST dataset will be partitioned into 100 partitions
partitioner = IidPartitioner(num_partitions=100)
fds = FederatedDataset("ylecun/mnist", partitioners={"train": partitioner})
partition = fds.load_partition(0)
centralized_data = fds.load_split("test")
For more details, please refer to the specific how-to guides or tutorial. They showcase customization and more advanced features.
Here are a few of the things that we will work on in future releases:
Partitioner
s.Partitioner
s.Partitioner
s via FederatedDataset
's partitioners
argument.FAQs
Flower Datasets
We found that flwr-datasets demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.