Rewrote state iterator; added documentation and tests - #23
Open
cogumbreiro wants to merge 24 commits into
Open
cogumbreiro wants to merge 24 commits into
cogumbreiro wants to merge 24 commits into
Conversation
Method `infer_state_iter_ex` replaces `infer_state_iter` with a simpler interface and improved performance. 1. The output becomes a sequence of rows, each row pairs call names with probabilities. 2. There are half the number of calls to Tensorflow via `infer_seq_iter`, which is less of a problem with a cache, but it is still an improvement. 3. Added a preliminary testing module that defines a basic notion of correctness. Currently, we are only measuring if we are doing the same calls to the TensorFlow model. We are currently *not* what distribution probabilities are given to the user. 4. Rewrote `kld` to use the new interface, which becomes simpler due to streamlined API.
Collaborator
Author
|
Pinging @vineethk @asingh-gt |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
infer.py) to document the code and improve testing.BayesianPredictordocumentationThe
BayesianPredictoroffers two main capabilities, both of whichtake a call-sequence as an input and output an iterator to navigate the
distribution probabilities of the given call-sequence.
Method
Model.infer_call_iteroffers the simplest capability: it allows theuser to iterate over the distribution probability given a sequence of calls and
ignores the states of each term. The return value of
Model.infer_call_iteris an iterator of pairs that contain the term name (a string) and the
probability distribution.
For instance, given an instance
predofBayesianPredictor, we can yieldthe probability of each term in in a sequence of calls
callswith thefollowing code:
Method
Model.infer_state_iterallows the user to iterate over thedistribution probability given a sequence of calls, including the states
of each term. The return value of
Model.infer_state_iteris an iterator of lists; each list pairs the term name (a string) with the
probability distribution. The first element of each list is the call name
and the distribution of the call name, the subsequent pairs consist of the
distribution probability for each state of that call name.
For instance, say that we want to "flatten" the output of
Model.infer_state_iter. In the following code we yield the probabilityof each call name and of each state in a single iterator.