|
I am trying to use Joachim's SVMstruct to learn a MRF using max-margin training. As I want to use graph cuts for inference, I want my energy function to be submodular. This should be easy to achieve by restricting non-diagonal pairwise terms to be positive. SVMstruct has an option to include additional constraints such as this, it is even given as an example. Still, I was not able to really enforce these constraints - even with a cost factor for 1e10, my weights are all negative. Does any one have any experience with this algorithm / software? If someone has any hints on what I could be doing wrong, any help would be very much appreciated. Btw, I am using the Python interface.
This question is marked "community wiki".
|
|
The newest release of the dlib library updates its structural SVM solver to support a non-negativity constraint. You don't have to define anything special yourself or set penalty factors, just tell it which terms you want to be non-negative and it will do the right thing. There is also an object specifically for doing max-margin training on a kind of MRF solvable with graph cuts. As a disclaimer, I wrote this library. :)
This answer is marked "community wiki".
Thanks Davis, this sounds awesome! At the moment I'm working with my own simple implementation in Python. I haven't heard about your library but it looks great. I'll have a more detailed look if I find the time.
(Jun 16 '12 at 08:13)
Andreas Mueller
|
|
You are not doing anything wrong, but the constraints are only enforced up to the current precision of the solver (denoted by epsilon). See the following code from the original
The Python equivalent (without the slackid hack) is the following:
This answer is marked "community wiki".
|