#29 Open
Repository
Branch
taggedXData
Repository
Branch
master

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

git checkout master
git merge --no-ff -m 'Merged in taggedXData (pull request #29)' remotes/origin/taggedXData
Author
  1. Will Stephenson
Reviewers
Description

This branch implements changes outlined in issue #31 and some of issue #32. It contains a new GraphXData.py used for storing graph-based data

GraphXData.py

This is a new data object used for storing graph data. Data is stored in a E x D matrix, where observation e sits on the edge going from node with ID GraphXData.sourceID[e] to GraphXData.destID[e].

BernObsModel.py

Changes to BernObsModel address issue #31 : that some allocation models may specify sufficient statistics that are not of dimension K x D. Note that the changes don't account for data that is not a 2-D array, as is suggested in issue #31. These changes are currently only implemented for BernObsModel, but should be easy to add to other obsmodels.

For existing models, the changes produce the same behavior:

python -m bnpy.Run JainNealEx1 FiniteMixtureModel Bern VB --K 5 

RESULT ON TAGGEDXDATA BRANCH:
Trial  1/1 | alg. seed: 4226944 | data order seed: 8541952
savepath: /research/people/wtstephe/outdir/JainNealEx1/defaultjob/1
        1/10 after      0 sec. | K    5 | ev -6.155503017e-01 |  
        2/10 after      0 sec. | K    5 | ev -6.025694195e-01 | Ndiff    1.273 
        3/10 after      0 sec. | K    5 | ev -5.943878465e-01 | Ndiff    1.255 
        4/10 after      0 sec. | K    5 | ev -5.878799989e-01 | Ndiff    1.119 
        5/10 after      0 sec. | K    5 | ev -5.831982867e-01 | Ndiff    0.864 
        6/10 after      1 sec. | K    5 | ev -5.786238231e-01 | Ndiff    0.631 
        7/10 after      1 sec. | K    5 | ev -5.778562889e-01 | Ndiff    0.167 
        8/10 after      1 sec. | K    5 | ev -5.778520682e-01 | Ndiff    0.045 
... done. converged.

RESULT ON MASTER BRANCH:
Trial  1/1 | alg. seed: 4226944 | data order seed: 8541952
savepath: /research/people/wtstephe/outdir/JainNealEx1/defaultjob/1
        1/10 after      0 sec. | K    5 | ev -6.155503017e-01 |  
        2/10 after      0 sec. | K    5 | ev -6.025694195e-01 | Ndiff    1.273 
        3/10 after      0 sec. | K    5 | ev -5.943878465e-01 | Ndiff    1.255 
        4/10 after      0 sec. | K    5 | ev -5.878799989e-01 | Ndiff    1.119 
        5/10 after      0 sec. | K    5 | ev -5.831982867e-01 | Ndiff    0.864 
        6/10 after      0 sec. | K    5 | ev -5.786238231e-01 | Ndiff    0.631 
        7/10 after      0 sec. | K    5 | ev -5.778562889e-01 | Ndiff    0.167 
        8/10 after      0 sec. | K    5 | ev -5.778520682e-01 | Ndiff    0.045 
... done. converged.

Comments (4)

  1. Mike Hughes repo owner

    Thanks! I really like the side-by-side comparison to verify you haven't broken existing functionality.

    I'll dive into the code soon to verify in detail, but looks good so far.

  2. Will Stephenson author

    This is a bit out of place for this branch, but I also just added a flag to save sufficient statistics at each save point. It works exactly the same as saving obsmodel parameters: it can be turned on / off with --doSaveSuffStats 1 / 0 (default is 1), and copies the saving behavior of the obsmodel / allocmodel.

  3. Will Stephenson author

    Alright, the most recent push should fix the transpose issue in BernObsModel.

  4. Mike Hughes repo owner

    I like where most of this is going. However, I'm not going to accept until we fix the following TODO

    NotImplementedError: Merges not functional with obsmodel changes