Conversation
|
great! I wanted to have an example like that for a long time! |
|
One test I usually do is that the energy of the configuration (returned by the inference or by |
|
On the other hand, as you inherited everything from |
|
I don't remember exactly if I need it, it might need some refactoring in Something that I wanted to comment on, though it's a bit off-topic here: On Thu, Jun 27, 2013 at 2:25 PM, Andreas Mueller
|
|
Yes, this is annoying. |
|
There are certain times when I am doubtful that having the learner own the model was a good idea. Maybe it should have been the other way around ^^ |
|
But doing it the other way round, the |
|
Maybe it's the CV that needs to be aware and initialize the model everytime? BTW I got sparse support for the chains with 2 lines of code, but I need to On Thu, Jun 27, 2013 at 2:46 PM, Andreas Mueller
|
|
sweet. should I merge the rest in the meantime? Could you remove the commented out code? And is there a way to redo the example as a |
|
|
Some explanation to the example would also be nice ;) And maybe also add that as a test? |
pystruct/models/chain_crf.py
Outdated
There was a problem hiding this comment.
For a chain, the default inference should probably be belief propagation via LibDAI. Move-making doesn't make much sense.
|
I am about to merge #44. I'll leave this one open, though, as I didn't include the syllable example. Maybe you find the time to polish the example a bit. That would be awesome! |
|
I'll try to polish it this weekend. Unless @vene is on it |
|
Thanks @zaxtax that would be awesome. I might branch before that but I can always cherry-pick it later. |
|
cool I'll give it a shot later / tomorrow :) |
|
Just wondering, what kind of results do you get on this? I ported your example to seqlearn and I only got ~43% accuracy with your features. I probably did something wrong :( |
|
With the example exactly as it is (so with the SubgradientSSVM) I get 72 Could I have the code you used with seqlearn? On Wed, Aug 14, 2013 at 11:34 PM, Lars Buitinck [email protected]:
|
Are you sure? Your code says Mine is here. It's messy. |
|
I'm pretty sure, but I agree my line is very dense and unclear. Basically before scoring it turns the 0, 1, 2, ... 7 label set into {0, 1}, I re-ran the example with a vanilla perceptron with 5 iterations So basically quite worse loss than seqlearn, strangely better end resuit The SVM gets 0.72, while (in some experiments I did a month ago) CRFsuite
On Thu, Aug 15, 2013 at 12:32 AM, Lars Buitinck [email protected]:
|
|
Setting |
|
What I mean is that you compute the custom ( |
|
Oops, yeah. Sorry about that, now I get 46% too. On Thu, Aug 15, 2013 at 9:48 AM, Lars Buitinck [email protected]:
|
|
I manually applied this patch to pystruct and tested the performance with the sparse matrices support. RAM usage is decreased ~10x and the speed is increased ~6x. I needed this because FrankWolfeSSVM with ChainCRF was eating up gigabytes of RAM for certain inputs. I am currently trying to classify bytes inside a binary executable files, so for each byte in the binary file I have an 1-hot vector of 256 elements to give as input to the ChainCRF. Without sparse matrices, the input size would be 256 times the actual size of the binary! Thank you! Please consider merging this :) |
|
@pietrodn would you mind picking this up and creating some examples and benchmarks? |
Rebased this PR to contain just the linear CRF example, cleaned up. It's visibly slower than it should be for such small data (even with
inference='unary'), now we can use it to check why.