opengm / opengm

A C++ Library for Discrete Graphical Models
MIT License
411 stars 206 forks source link

Estimating weights of functions #203

Closed pmcao closed 10 years ago

pmcao commented 10 years ago

Hello there,

I am using @opengm python binding for modeling Conditional Random Fields. Besides with inference, does @opengm support estimating weights for each function, i.e., parameter estimation step?

I found a line in @opengm python binding that seems to be used to estimate parameter (line #10 in the file src/interfaces/python/example/inference_bp.py)

opengm.InfParam(steps=10,damping=0.5,convergenceBound=0.001)

Could you please confirm this is the function used to estimate parameters? If @opengm does not support parameter estimation, can I use other libraries such as libDAI or FastInf for estimating parameter, then use @opengm to do inference?

Thank you.

opengm commented 10 years ago

Hi, OpenGM does not provide learning methods so far. We have started with something in this direction, but it has not the highest priority. Building a general and flexible learning framework is no so simple.

However, OpenGM can be used to calculate MAP solutions or marginals, which is often one of the core steps in learning algorithms.

Best Joerg

On 01/28/2014 07:41 AM, pmcao wrote:

Hello there,

I am using OpenGM python binding for modeling Conditional Random Fields. Besides with inference, does OpenGM support estimating weights for each function, i.e., parameter estimation step?

— Reply to this email directly or view it on GitHub https://github.com/opengm/opengm/issues/203.

pmcao commented 10 years ago

Awesome! Thank you @joergkappes.

pmcao commented 10 years ago

@joergkappes Do you have any suggestion for learning the models? Is there any good library out there? Thanks.

joergkappes commented 10 years ago

Since You never explain what kind of learning You are looking for, it is hard to say which library fit your needs.

On 02/01/2014 06:38 PM, pmcao wrote:

@joergkappes https://github.com/joergkappes Do you have any suggestion for learning the models? Is there any good library out there? Thanks.

— Reply to this email directly or view it on GitHub https://github.com/opengm/opengm/issues/203#issuecomment-33878011.

prassanna-ravishankar commented 10 years ago

Is this implemented yet? it would save my project - literally

joergkappes commented 10 years ago

Hi, so far we have no generic support for learning parameters. in the C++-tutorials we have a simple example for learning simple Gaussian classifiers within a graphical model. Maybe we will add another example for a special case next month.

So far I can point You to another library PyStruct (https://pystruct.github.io/) This has an opengm-backend, but learning is restricted to special cases/models.

I hope this saves your day ;-)