-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingdesignIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementpriority: 1Medium priority taskMedium priority task
Milestone
Description
How should I use gradient_clip_val if I only want to clip the discriminator in GAN?
Currently, I try to clip the discriminator as follows and I get an error:
def optimizer_step(self, current_epoch, batch_idx, optimizer, optimizer_idx,*args,**kwargs):
optimizer.step()
optimizer.zero_grad()
if optimizer_idx==0:
for p in self.Discriminator.parameters():#weight clipping
p.data.clamp_(-0.01, 0.01)
The error is:
TypeError: optimizer_step() missing 1 required positional argument: 'current_epoch'
I use pl==1.1.0 on colab
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdesignIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementpriority: 1Medium priority taskMedium priority task