This repository was archived by the owner on Apr 8, 2021. It is now read-only.
Conversation
| def containsKey(key: A): Boolean = randValue(key) <= threshold | ||
| def update(key: A, value: B) { | ||
| if(containsKey(key)) | ||
| mapValues += key -> value |
Contributor
There was a problem hiding this comment.
Since we're just mutating these structures in place why don't we use mutable.Map for better performance?
Contributor
Author
|
Per IRL conversation, I'm going to merge this and @Striation might do a follow-up PR with his mutable optimizations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some work from the plane, ?r @Striation @tixxit
This has the same goal as #77 but is deliberately worse code (for now) in the interests of being less invasive and getting merged quickly. It completely avoids making any useful abstractions and instead just provides the most direct implementation of a single-node, single-pass-per-expansion local trainer.
The only interesting thing it does is this: by streaming over the training data we avoid using O(training set) memory, but if we try to expand an entire level at once, we still have an O(2^depth * features) problem. So
expandtakes a parameter of the maximum number of tree leaves to try to expand, per tree, in any one pass, and randomly picks which ones to do (using something like reservoir sampling to get a uniform sample of leaves that don't meet the stopping criteria). This lets you trade off memory use vs. performance (by forcing more passes but capping the memory).There's still the need to keep all of the trees in memory at once, so it's not truly constant memory, but that's harder to avoid. If it becomes a problem we can look at using bonsai representations even during training...