Skip to content

Commit

Permalink
fix: custom loss using inplace operations
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocarvp authored and Optimox committed Nov 8, 2021
1 parent c88bbf5 commit 423f7c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_tabnet/abstract_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def _train_batch(self, X, y):

loss = self.compute_loss(output, y)
# Add the overall sparsity loss
loss -= self.lambda_sparse * M_loss
loss = loss - self.lambda_sparse * M_loss

# Perform backward pass and optimization
loss.backward()
Expand Down

0 comments on commit 423f7c4

Please sign in to comment.