MXFusion icon indicating copy to clipboard operation
MXFusion copied to clipboard

Possible issue in forward sampling

Open tdiethe opened this issue 6 years ago • 1 comments

Describe the bug When doing forward sampling, my code hits the following line:

https://github.com/amzn/MXFusion/blob/9e8e0a096504a76bc5d6bc9d4509965eda14780c/mxfusion/models/factor_graph.py#L427

This looks like a bug to me as the model class never has a graph attribute at the top level (or does it?).

To Reproduce Steps to reproduce the behavior:

  1. Build a model like BNN
  2. Run inference on BNN on Task A.
  3. Fine tune for task A using posteriors from 2.
  4. Predict on task A using fine tuned model from 3.
  5. Run inference on BNN using posteriors from 2 on Task B.
  6. Fine tune for task A using posteriors from 5.
  7. Predict on task A using fine tuned model from 6.
  8. Fine tune for task B using posteriors from 5.
  9. Predict on task B using fine tuned model from 8.
  10. See error

Desktop (please complete the following information):

  • OS: OSX
  • Python version 3.6
  • MXNet version 1.3.0
  • MXFusion version 0.2.2
  • MXNet context CPU
  • MXNet dtype float32

Additional context Add any other context about the problem here.

tdiethe avatar Nov 23 '18 11:11 tdiethe

This is a bug on that line of code.

It should probably look something:

    new_leaf = v.replicate(var_map=var_map,
replication_function=lambda x: ('recursive', 'recursive'))
    new_leaf.graph = new_model.components_graph

meissnereric avatar Nov 23 '18 12:11 meissnereric