Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Linf contribution bounder analysis #532

Merged
merged 5 commits into from
Jan 14, 2025

Conversation

dvadym
Copy link
Collaborator

@dvadym dvadym commented Jan 10, 2025

This is used for analysis w/o cross partition contribution bounding

@dvadym dvadym requested a review from RamSaw January 10, 2025 17:11
@dvadym dvadym changed the title Create Linf contribution bounding for analysis Create Linf contribution bounder analysis Jan 13, 2025
analysis/contribution_bounders.py Outdated Show resolved Hide resolved
def __init__(self, partitions_sampling_prob: float):
def __init__(self,
partitions_sampling_prob: float,
perform_cross_partition_contribution_bounding: bool = True):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this param if we have LinfAnalysisContributionBounder? If it is false then it is the smae as LinfAnalysisContributionBounder.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is leftover of 1st approach that I though (with 1 class, instead of 2)

analysis/tests/contribution_bounders_test.py Outdated Show resolved Hide resolved
bound_result = self._run_contribution_bounding(input,
aggregate_fn=lambda x: x)

expected_result = [(('pid1', 'pk2'), (2, 7, 1, 2)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why (2, 7, 1, 2) if pk2 has only 3 and 4 values contributed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment

 # the output format: 
        # (count_per_partition, sum_per_partition, 
        # num_partition_contributed_per_privacy_id, 
        # num_contribution_per_privacy_id)
        # Since no cross-partition contribution, we consider that the privacy id
        # contributes only to this partition, so
        # num_partition_contributed_per_privacy_id = 1
        # num_contribution_per_privacy_id = count_per_partition

analysis/tests/utility_analysis_engine_test.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@dvadym dvadym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review!

def __init__(self, partitions_sampling_prob: float):
def __init__(self,
partitions_sampling_prob: float,
perform_cross_partition_contribution_bounding: bool = True):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is leftover of 1st approach that I though (with 1 class, instead of 2)

bound_result = self._run_contribution_bounding(input,
aggregate_fn=lambda x: x)

expected_result = [(('pid1', 'pk2'), (2, 7, 1, 2)),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment

 # the output format: 
        # (count_per_partition, sum_per_partition, 
        # num_partition_contributed_per_privacy_id, 
        # num_contribution_per_privacy_id)
        # Since no cross-partition contribution, we consider that the privacy id
        # contributes only to this partition, so
        # num_partition_contributed_per_privacy_id = 1
        # num_contribution_per_privacy_id = count_per_partition

@dvadym dvadym merged commit d46ab85 into OpenMined:main Jan 14, 2025
6 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants