f92bb9c15933724e68547efd90648f26096df035,thinc/layers/lstm.py,,init,#Any#Any#Any#Any#Any#,61

Before Change


        model.set_dim("nI", get_width(X))
    if Y is not None:
        model.set_dim("nO", get_width(Y))
    nO = model.get_dim("nO")
    nI = model.get_dim("nI")
    depth = model.get_dim("depth")
    dirs = model.get_dim("dirs")
    // It"s easiest to use the initializer if we alloc the weights separately
    // and then stick them all together afterwards. The order matters here:
    // we need to keep the same format that CuDNN expects.
    params = []
    // Convenience
    init_W = partial(init_W, model.ops)
    init_b = partial(init_b, model.ops)
    layer_nI = nI
    for i in range(depth):
        for j in range(dirs):
            // Input-to-gates weights and biases.
            params.append(init_W((nO, layer_nI)))
            params.append(init_W((nO, layer_nI)))
            params.append(init_W((nO, layer_nI)))
            params.append(init_W((nO, layer_nI)))
            params.append(init_b((nO,)))
            params.append(init_b((nO,)))
            params.append(init_b((nO,)))
            params.append(init_b((nO,)))
            // Hidden-to-gates weights and biases
            params.append(init_W((nO, nO)))
            params.append(init_W((nO, nO)))
            params.append(init_W((nO, nO)))
            params.append(init_W((nO, nO)))
            params.append(init_b((nO,)))
            params.append(init_b((nO,)))

After Change


        model.set_dim("nI", get_width(X))
    if Y is not None:
        model.set_dim("nO", get_width(Y))
    nH = int(model.get_dim("nO") / model.get_dim("dirs"))
    nI = model.get_dim("nI")
    depth = model.get_dim("depth")
    dirs = model.get_dim("dirs")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: explosion/thinc
Commit Name: f92bb9c15933724e68547efd90648f26096df035
Time: 2021-03-09
Author: svlandeg@users.noreply.github.com
File Name: thinc/layers/lstm.py
Class Name:
Method Name: init


Project Name: explosion/thinc
Commit Name: 0afa83b99fccef7be77ec5bb3fb1321f5a4b4dd6
Time: 2020-01-07
Author: justindujardin@users.noreply.github.com
File Name: thinc/tests/integration/test_affine_learns.py
Class Name:
Method Name: test_predict_bias


Project Name: explosion/thinc
Commit Name: 0afa83b99fccef7be77ec5bb3fb1321f5a4b4dd6
Time: 2020-01-07
Author: justindujardin@users.noreply.github.com
File Name: thinc/layers/staticvectors.py
Class Name:
Method Name: init


Project Name: explosion/thinc
Commit Name: 0afa83b99fccef7be77ec5bb3fb1321f5a4b4dd6
Time: 2020-01-07
Author: justindujardin@users.noreply.github.com
File Name: thinc/layers/parametricattention.py
Class Name:
Method Name: init


Project Name: explosion/thinc
Commit Name: 0afa83b99fccef7be77ec5bb3fb1321f5a4b4dd6
Time: 2020-01-07
Author: justindujardin@users.noreply.github.com
File Name: thinc/layers/cauchysimilarity.py
Class Name:
Method Name: init