Dynamically change optimizer frequency
❓ Questions and Help
What is your question?
I have a WGAN and the ratio between iterations on the discriminator and on the generator is fixed at 5:1. I accomplished this by passing the frequency parameter in the configure_optimizers method
res_1 = {
            'optimizer': optimizer_d,
            'frequency': 5,
            'lr_scheduler': scheduler_d
        }

same for generator
res_2 = {
            'optimizer': optimizer_g,
            'frequency': 1, 
            'lr_scheduler': scheduler_g
        }

How can I dynamically change the frequency parameter, such that for the first n iterations I have a frequency x and after I have a frequency y.
Code
Don't know how to do it.
What have you tried?
What's your environment?

OS: OS independent
Packaging: pip
Version: 0.7.6