Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the meaning of the argument skip? #29

Closed
edward-zhu opened this issue Aug 4, 2015 · 1 comment
Closed

What's the meaning of the argument skip? #29

edward-zhu opened this issue Aug 4, 2015 · 1 comment

Comments

@edward-zhu
Copy link

Hi @tmbdev,

I am trying to figure out how the CTC works in clstm and got stuck.

I'm confused when looking into the following code in ctc.cc.

void forward_algorithm(Mat &lr, Mat &lmatch, double skip) {
    int n = ROWS(lmatch), m = COLS(lmatch);
    lr.resize(n, m);
    Vec v(m), w(m);
    for (int j = 0; j < m; j++) v(j) = skip * j;
    for (int i = 0; i < n; i++) {
        w.segment(1, m-1) = v.segment(0, m-1);
        w(0) = skip * i;
        for (int j = 0; j < m; j++) {
            Float same = log_mul(v(j), lmatch(i, j));
            Float next = log_mul(w(j), lmatch(i, j));
            v(j) = log_add(same, next);
        }
        lr.row(i) = v;
    }
}

I'm wondering what the argument skip means since it not in the original thesis of Graves nor in the source code of rnnlib.

Thanks!

@tmbdev
Copy link
Owner

tmbdev commented Aug 5, 2015

It's the cost of skipping states at the beginning of the match. To get the same behavior as Graves' thesis, you probably should set that to a large value.

@tmbdev tmbdev closed this as completed Aug 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants