-
Notifications
You must be signed in to change notification settings - Fork 4
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
Rewrote state iterator; added documentation and tests #23
Open
cogumbreiro
wants to merge
24
commits into
trishullab:master
Choose a base branch
from
cogumbreiro:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
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.
Pinging @vineethk @asingh-gt |
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.BayesianPredictor
documentationThe
BayesianPredictor
offers 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_iter
offers 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_iter
is an iterator of pairs that contain the term name (a string) and the
probability distribution.
For instance, given an instance
pred
ofBayesianPredictor
, we can yieldthe probability of each term in in a sequence of calls
calls
with thefollowing code:
Method
Model.infer_state_iter
allows 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_iter
is 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.