Git Product home page Git Product logo

crf's People

Contributors

fgregg avatar ogirardot avatar timvieira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crf's Issues

execute "run" first, and then execute "load" , that will throw error

Traceback (most recent call last):
File "crf/example.py", line 144, in
main()
File "crf/example.py", line 138, in main
run(proportion=[0.7, 0.3], load='model.pkl~')
File "crf/example.py", line 104, in run
validate(crf)
File "crf/example.py", line 93, in validate
llh = sum(map(crf.likelihood, iterview(train, msg='llh'))) / len(train)
File "/crf/crf/crf.py", line 100, in likelihood
(g0, g) = self.log_potentials(x)
File "/crf/crf/crf.py", line 58, in log_potentials
g0[y] = W[f[0,None,y]].sum()
TypeError: 'NoneType' object has no attribute 'getitem'

AttributeError: 'Alphabet' object has no attribute 'stop_growth'

i ran this on repl.it after installing arsenal and crf package successfully.

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-ykbg_s95 because the default path (/config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Traceback (most recent call last):
  File "crf/example.py", line 160, in <module>
    main()
  File "crf/example.py", line 154, in main
    run_test()
  File "crf/example.py", line 126, in run_test
    (L, A) = build_domain(train)
  File "/home/runner/SorrowfulKnowledgeableOrigin/crf/crf/stringcrf.py", line 20, in build_domain
    A.stop_growth()
AttributeError: 'Alphabet' object has no attribute 'stop_growth'```

Noise cleaning on segmentations

Hi!

Thanks for sharing this code. I wanted to know if it is possible to use this code to clean classifier predictions where each pixel gets a probability value of a particular class. If so, is there an example that I can look at?

Thanks!

Can you have a little explain about the a0 parameter and rate in sgd part

Really apperciate your work, i have investigated your code but have some confusion part.
in the code

    def sgd(self, data, iterations=20, a0=10, validate=None):
        """ Parameter estimation with stochastic gradient descent (sgd). """
        self.preprocess(data)
        W = self.W
        for i in range(iterations):
            rate = a0 / (i + 1)**0.501
            for x in iterview(data, msg='Iteration %s' % i):
                for k, v in self.expectation(x).items():
                    W[k] -= rate*v
                for k in x.target_features:
                    W[k] += rate
            if validate:
                validate(self, i)
  • Is it a parameter restore or fix for the warm-up stage? for the result the gradient at warm-up stage may fluctuate violently, so restore parameter by add some scales can mitigate this.
  • But why not fix the gradient(here is the expectation logit) directly, is there some theory analysis about these two method?

License?

Hi!

Thanks for this code. What's the License for it? Would you consider an MIT license or a compatible?

Question about feature function

Hi, I'm confused about the feature function. In your code, is feature function defined in the method FeatureVectorSequence?

how to run it?

ubgpu@ubgpu:/github/crf$ python example.py run 100
Traceback (most recent call last):
File "example.py", line 138, in
main(proportion=[0.7, 0.3], iterations=args.interations)
AttributeError: 'Namespace' object has no attribute 'interations'
ubgpu@ubgpu:
/github/crf$ echo $PYTHONPATH
/home/ubgpu/github/arsenal:/usr/local/lib/python2.7/dist-packages
ubgpu@ubgpu:~/github/crf$

Potential bug

Hi Tim,

I was using your code as a base for a course homework I'm TAing.

I was looking at your forward code and I was wondering if you had a rationale for how you use the logexpsum.

Looking at Sutton & McCallum [1] and taking alpha as forward recursion variable, it seems that each forward recursion is:

alpha(thisstate) = sum_laststate exp(transition_potential)*alpha(laststate)

You are adding the alpha(laststate) to the transition potential, exponentiating, summing, and logging (and some interesting max operator thing going on).

Can you really combine the alpha and transition in the exponential? I don't see how you push an exponential function back to the outside in each alpha to allow for such an operation.

Thanks!

[1] Sutton & McCallum. Page 15. Section 1.3.3. Eq. 1.37. http://people.cs.umass.edu/~mccallum/papers/crf-tutorial.pdf

(side note, I believe we met at MASC this year)

Best,
Brian

can crf predict like hmm

hello, i know that hmm can predict the label of one observed sequence such as predict the word of one speech.can crf do the same thing ...the steps are like:
1.first train the different crf models with diffenrent set of samples
2.input the sequence that want predicting to different models and get the probabilities of diffenrent models
3.find the model that has the maximum probability,and the label the sequence with the model's label.

thanks a lot!

ask for a guide

Hey,pal ! I wanna program the crf in python,but I still diidn't understand it and being puzzled. Could you send me some tutorials of CRF or tell me how to learn it please? Any guidance would be greatly appreciated! Thanks in advance!

Potential bug with parameter matrix[W] initialization

Hi, After we done some experiment, we found that, In stringcrf2.py the size of W (crf feature function parameter matrix) should be (A+L)_L instead of A_L. After fixing size issue and a related line of code, we can achieve higher llh on same dataset and also monotonically increase after iteration. However, it could be highly possible that we are wrong, so please check that. We are looking forward to hear from you, thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.