Skip to content

Wrong training ? #7

Description

@Mandelbr0t

in train.py

loss_critic = F.smooth_l1_loss(y_predicted, y_expected)
self.critic_optimizer.zero_grad()
loss_critic.backward()
self.critic_optimizer.step()

Is it correct to set the gradients in the optimizer to zero after calculating the loss or should it be the other way around i.e. setting all gradients to zero, then taking the loss and performing an update?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions