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

Feature Request: Context Manager for training mixed private and public data #40

Open
bnestor opened this issue Feb 26, 2024 · 0 comments

Comments

@bnestor
Copy link

bnestor commented Feb 26, 2024

Hi,

I am training on multiple datasets, some private some public. I want to only use DP on the private samples. I could pass an indicator with my batches to indicate if it is a batch of private or public data. I would like to have:

if private_data:
    with private_context(enabled=True):
        training_step(batch)
else:
    training_step(batch)

I think the only workaround I can think of is to use two different optimizers; one with the privacy engine and one without. Then I would load the state dict every time I switch between to keep the optimizer consistent.

How easy would it be to bake in a context manager?

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

No branches or pull requests

1 participant