Forming conditional distributions in TensorFlow probability












-1















I am using Tensorflow Probability to build a VAE which includes image pixels as well as some other variables. The output of the VAE:



tfp.distributions.Independent(tfp.distributions.Bernoulli(logits), 2, name="decoder-dist")


I am trying to understand how to form other conditional distributions based on this which I can use with the inference methods (MCMC or VI). Say the output above was P(A,B,C | Z), how would I take that distribution to form a posterior P(A|B, C, Z) that I could perform inference on? I have been trying to read through the docs but I am having some trouble grasping them.










share|improve this question

























  • Anyone know if I can increase the bounty on this after its been set? I would really appreciate some help getting this answered.

    – taylormade201
    Nov 25 '18 at 0:31
















-1















I am using Tensorflow Probability to build a VAE which includes image pixels as well as some other variables. The output of the VAE:



tfp.distributions.Independent(tfp.distributions.Bernoulli(logits), 2, name="decoder-dist")


I am trying to understand how to form other conditional distributions based on this which I can use with the inference methods (MCMC or VI). Say the output above was P(A,B,C | Z), how would I take that distribution to form a posterior P(A|B, C, Z) that I could perform inference on? I have been trying to read through the docs but I am having some trouble grasping them.










share|improve this question

























  • Anyone know if I can increase the bounty on this after its been set? I would really appreciate some help getting this answered.

    – taylormade201
    Nov 25 '18 at 0:31














-1












-1








-1


1






I am using Tensorflow Probability to build a VAE which includes image pixels as well as some other variables. The output of the VAE:



tfp.distributions.Independent(tfp.distributions.Bernoulli(logits), 2, name="decoder-dist")


I am trying to understand how to form other conditional distributions based on this which I can use with the inference methods (MCMC or VI). Say the output above was P(A,B,C | Z), how would I take that distribution to form a posterior P(A|B, C, Z) that I could perform inference on? I have been trying to read through the docs but I am having some trouble grasping them.










share|improve this question
















I am using Tensorflow Probability to build a VAE which includes image pixels as well as some other variables. The output of the VAE:



tfp.distributions.Independent(tfp.distributions.Bernoulli(logits), 2, name="decoder-dist")


I am trying to understand how to form other conditional distributions based on this which I can use with the inference methods (MCMC or VI). Say the output above was P(A,B,C | Z), how would I take that distribution to form a posterior P(A|B, C, Z) that I could perform inference on? I have been trying to read through the docs but I am having some trouble grasping them.







tensorflow machine-learning autoencoder tensorflow-probability






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 2:28







taylormade201

















asked Nov 21 '18 at 22:13









taylormade201taylormade201

2661520




2661520













  • Anyone know if I can increase the bounty on this after its been set? I would really appreciate some help getting this answered.

    – taylormade201
    Nov 25 '18 at 0:31



















  • Anyone know if I can increase the bounty on this after its been set? I would really appreciate some help getting this answered.

    – taylormade201
    Nov 25 '18 at 0:31

















Anyone know if I can increase the bounty on this after its been set? I would really appreciate some help getting this answered.

– taylormade201
Nov 25 '18 at 0:31





Anyone know if I can increase the bounty on this after its been set? I would really appreciate some help getting this answered.

– taylormade201
Nov 25 '18 at 0:31












1 Answer
1






active

oldest

votes


















2





+50









The answer to your question depends very much on the nature of the joint model within which you'd like to do the conditioning. Much has been written about the topic, and in short it's a very hard problem in general :). Without knowing a bit more about the particulars of your problem, it's near impossible to recommend a useful generic inference procedure. However, we do have a bunch of examples (scripts and jupyter/colab notebooks) in the TFP repo here: https://github.com/tensorflow/probability/tree/master/tensorflow_probability/examples



In particular, there's




  • The Hierarchical Linear Model example, which is a sort of Rosetta stone showing how to do posterior inference using Hamiltonian Monte Carlo (an MCMC technique) in TFP, R, and Stan,


  • The Linear Mixed Effects Model example, showing how you might use VI to solve a standard LME problem,



among many others. You can click the "Run in Google Colab" link at the top of any of these notebooks to open and run on them on https://colab.research.google.com.



Please feel free, also, to reach out on to us via email at tfprobability@tensorflow.org. This is a public Google Group where users can engage with the team that builds TFP directly. If you provide us some more info there on what you'd like to do, we're happy to provide guidance on modeling and inference with TFP.



Hope this is gives at least a start in the right direction!






share|improve this answer



















  • 1





    Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

    – taylormade201
    Nov 27 '18 at 22:58






  • 1





    I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

    – taylormade201
    Nov 27 '18 at 23:23













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421179%2fforming-conditional-distributions-in-tensorflow-probability%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2





+50









The answer to your question depends very much on the nature of the joint model within which you'd like to do the conditioning. Much has been written about the topic, and in short it's a very hard problem in general :). Without knowing a bit more about the particulars of your problem, it's near impossible to recommend a useful generic inference procedure. However, we do have a bunch of examples (scripts and jupyter/colab notebooks) in the TFP repo here: https://github.com/tensorflow/probability/tree/master/tensorflow_probability/examples



In particular, there's




  • The Hierarchical Linear Model example, which is a sort of Rosetta stone showing how to do posterior inference using Hamiltonian Monte Carlo (an MCMC technique) in TFP, R, and Stan,


  • The Linear Mixed Effects Model example, showing how you might use VI to solve a standard LME problem,



among many others. You can click the "Run in Google Colab" link at the top of any of these notebooks to open and run on them on https://colab.research.google.com.



Please feel free, also, to reach out on to us via email at tfprobability@tensorflow.org. This is a public Google Group where users can engage with the team that builds TFP directly. If you provide us some more info there on what you'd like to do, we're happy to provide guidance on modeling and inference with TFP.



Hope this is gives at least a start in the right direction!






share|improve this answer



















  • 1





    Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

    – taylormade201
    Nov 27 '18 at 22:58






  • 1





    I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

    – taylormade201
    Nov 27 '18 at 23:23


















2





+50









The answer to your question depends very much on the nature of the joint model within which you'd like to do the conditioning. Much has been written about the topic, and in short it's a very hard problem in general :). Without knowing a bit more about the particulars of your problem, it's near impossible to recommend a useful generic inference procedure. However, we do have a bunch of examples (scripts and jupyter/colab notebooks) in the TFP repo here: https://github.com/tensorflow/probability/tree/master/tensorflow_probability/examples



In particular, there's




  • The Hierarchical Linear Model example, which is a sort of Rosetta stone showing how to do posterior inference using Hamiltonian Monte Carlo (an MCMC technique) in TFP, R, and Stan,


  • The Linear Mixed Effects Model example, showing how you might use VI to solve a standard LME problem,



among many others. You can click the "Run in Google Colab" link at the top of any of these notebooks to open and run on them on https://colab.research.google.com.



Please feel free, also, to reach out on to us via email at tfprobability@tensorflow.org. This is a public Google Group where users can engage with the team that builds TFP directly. If you provide us some more info there on what you'd like to do, we're happy to provide guidance on modeling and inference with TFP.



Hope this is gives at least a start in the right direction!






share|improve this answer



















  • 1





    Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

    – taylormade201
    Nov 27 '18 at 22:58






  • 1





    I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

    – taylormade201
    Nov 27 '18 at 23:23
















2





+50







2





+50



2




+50





The answer to your question depends very much on the nature of the joint model within which you'd like to do the conditioning. Much has been written about the topic, and in short it's a very hard problem in general :). Without knowing a bit more about the particulars of your problem, it's near impossible to recommend a useful generic inference procedure. However, we do have a bunch of examples (scripts and jupyter/colab notebooks) in the TFP repo here: https://github.com/tensorflow/probability/tree/master/tensorflow_probability/examples



In particular, there's




  • The Hierarchical Linear Model example, which is a sort of Rosetta stone showing how to do posterior inference using Hamiltonian Monte Carlo (an MCMC technique) in TFP, R, and Stan,


  • The Linear Mixed Effects Model example, showing how you might use VI to solve a standard LME problem,



among many others. You can click the "Run in Google Colab" link at the top of any of these notebooks to open and run on them on https://colab.research.google.com.



Please feel free, also, to reach out on to us via email at tfprobability@tensorflow.org. This is a public Google Group where users can engage with the team that builds TFP directly. If you provide us some more info there on what you'd like to do, we're happy to provide guidance on modeling and inference with TFP.



Hope this is gives at least a start in the right direction!






share|improve this answer













The answer to your question depends very much on the nature of the joint model within which you'd like to do the conditioning. Much has been written about the topic, and in short it's a very hard problem in general :). Without knowing a bit more about the particulars of your problem, it's near impossible to recommend a useful generic inference procedure. However, we do have a bunch of examples (scripts and jupyter/colab notebooks) in the TFP repo here: https://github.com/tensorflow/probability/tree/master/tensorflow_probability/examples



In particular, there's




  • The Hierarchical Linear Model example, which is a sort of Rosetta stone showing how to do posterior inference using Hamiltonian Monte Carlo (an MCMC technique) in TFP, R, and Stan,


  • The Linear Mixed Effects Model example, showing how you might use VI to solve a standard LME problem,



among many others. You can click the "Run in Google Colab" link at the top of any of these notebooks to open and run on them on https://colab.research.google.com.



Please feel free, also, to reach out on to us via email at tfprobability@tensorflow.org. This is a public Google Group where users can engage with the team that builds TFP directly. If you provide us some more info there on what you'd like to do, we're happy to provide guidance on modeling and inference with TFP.



Hope this is gives at least a start in the right direction!







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 26 '18 at 22:49









Chris SuterChris Suter

471148




471148








  • 1





    Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

    – taylormade201
    Nov 27 '18 at 22:58






  • 1





    I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

    – taylormade201
    Nov 27 '18 at 23:23
















  • 1





    Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

    – taylormade201
    Nov 27 '18 at 22:58






  • 1





    I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

    – taylormade201
    Nov 27 '18 at 23:23










1




1





Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

– taylormade201
Nov 27 '18 at 22:58





Thanks Chris, I really appreciate your reply. After thinking about it a lot, I don't think I am forming the right problem or even asking the right question. I will make a new, more detailed post on the Google group and hopefully get some guidance from the community. Thanks again!

– taylormade201
Nov 27 '18 at 22:58




1




1





I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

– taylormade201
Nov 27 '18 at 23:23







I posted the re-formulated question here groups.google.com/a/tensorflow.org/forum/#!topic/tfprobability/… Thanks again for the help

– taylormade201
Nov 27 '18 at 23:23




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421179%2fforming-conditional-distributions-in-tensorflow-probability%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Create new schema in PostgreSQL using DBeaver

Deepest pit of an array with Javascript: test on Codility

Costa Masnaga