-
Notifications
You must be signed in to change notification settings - Fork 321
Add a tracking of global loss in each epoch #23
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
base: master
Are you sure you want to change the base?
Conversation
Makes sense to track the loss. A couple of comments:
|
fit_vectors returns global loss Global loss printing over epochs only enabled if verbose is True
|
It just seems strange to have a one-element array when the same purpose can be served by just having a single number. Regarding the multithreading issue: I don't think this is a huge problem, just wanted to point out that that the loss numbers can be non-deterministic. |
|
||
fit_vectors(self.word_vectors, | ||
self.global_loss = fit_vectors(self.word_vectors, | ||
self.vectors_sum_gradients, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just fix the indentation of these lines? self.vectors_sum_gradients
should be indented to the same level as self.word_vectors
.
I was going to go in sneakily after this is merged and do that :) @ducovrossem as Radim pointed out, it will be more efficient to only calculate the As for the 0.5 factor: because the expression for the gradient of the loss does not have a |
Actually, why not factor out Or are the actual original counts/weights needed anywhere else, apart from Re. |
The raw value is used for the weighting (and I also quite like the fact that the co-occurrence matrix is marginally model agnostic and could conceivably support a different application). In general there is a fair amount of things that can still be factored out to just happen once (look at the bias updates for instance). I'll probably do a pass soon and get those out of the way. |
I know this pull request has gotten stale but is there any interest in getting it merged? I've managed to merge it into master locally and would be willing to fork and open a new pull request where we can discuss it. Three years have passed but it still looks like a valuable addition! |
It'd be really great to add this feature! |
Something to look at while training the model :)