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

[FIXED]: Increase in training time after each batch #3

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

Miraj98
Copy link
Owner

@Miraj98 Miraj98 commented Nov 12, 2022

After refactoring the neural net code to use the new tensor lib, there was a perf issue when training the data. In particular after batch, it progressively got slower. The issue was with the line that was updating the weights. However each of these updates is an op which was adding nodes to the computational graph even because of how the requires_grad flag was implemented. Hence after each batch the backprop had to be done on a larger and larger computational graph which was causing the issue.
The issue has been fixed temporarily by not having the operation done through tensors (there by not needing to think about the computational graph at all) but through raw ndarrays and then assigning a new tensor from it after all ops are done

@Miraj98 Miraj98 merged commit 781680c into master Nov 12, 2022
@Miraj98 Miraj98 deleted the nn-perf-improvment branch November 12, 2022 11:49
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

Successfully merging this pull request may close these issues.

1 participant