Re: [pystruct] Getting a probability using relaxed=True ? (EdgeFeatureGraphCRF with AD3)

42 views
Skip to first unread message

Andreas Mueller

unread,
Feb 19, 2017, 7:00:00 PM2/19/17
to pyst...@googlegroups.com
Hey.
Sorry for the late reply.
Those are not really marginal distributions. Could work as a heuristic but definitely not the right thing to do.
There is no probabilistic training in pystruct, so there is no way to get any kind of probabilities out.

Generally, unless exact inference is tractable (such as in a chain or tree), getting marginals might be tricky, I think.

Andy


On 10/21/2016 05:36 AM, JL Meunier wrote:
Hi,

I've trouble understanding the effect of relaxed=True in the inference method of EdgeFeatureGraphCRF. (I'm training it using OneSlackSSVM)

It seems that if setting relaxed=True, the only difference is that it returns the so-called unary_marginals instead of its argmax. (Line 388 of inference_methods.py in function inference_ad3 -- shown below)

In that case, doing a softmax on this unary_marginals would give me something close to a probability.

But does-it make sense??   

I'm unsure of what is a relaxed inference I must say... :-)

Thanks,

JL


Line 388 of inference_methods.py (in function inference_ad3):
    if solver_status in ["fractional", "unsolved"] and relaxed:
        unary_marginals = unary_marginals.reshape(unary_potentials.shape)
        y = (unary_marginals, pairwise_marginals)
    else:
        y = np.argmax(unary_marginals, axis=-1)
--
You received this message because you are subscribed to the Google Groups "pystruct" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystruct+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages