1b92598dbfb489fe0f7a1c9b2015db5d702be948,thinc/layers/embed.py,,Embed,#,15

Before Change


    attrs: Dict[str, Any] = {"column": column}
    if dropout is not None:
        attrs["dropout_rate"] = dropout
    return Model(
        "embed",
        forward,
        init=partial(init, initializer),
        attrs=attrs,
        dims={"nO": nO, "nV": nV},
        params={"E": None},
    )


def forward(model: Model[InT, OutT], ids: InT, is_train: bool) -> Tuple[OutT, Callable]:
    nV = model.get_dim("nV")

After Change


    attrs: Dict[str, Union[None, int, float]] = {}
    if dropout is not None:
        attrs["dropout_rate"] = dropout
    model = Model( // type: ignore
        "embed",
        forward,
        init=partial(init, initializer),
        attrs=attrs,
        dims={"nO": nO, "nV": nV},
        params={"E": None},
    )
    model = model if column is None else chain(ints_getitem(column), model)
    model.attrs["column"] = column
    return cast(Model[InT, OutT], model)



def forward(model: Model[InT, OutT], ids: InT, is_train: bool) -> Tuple[OutT, Callable]:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: explosion/thinc
Commit Name: 1b92598dbfb489fe0f7a1c9b2015db5d702be948
Time: 2020-01-28
Author: honnibal+gh@gmail.com
File Name: thinc/layers/embed.py
Class Name:
Method Name: Embed


Project Name: explosion/thinc
Commit Name: 5dccee984b2c25f6508947d3731b8934296ff4c5
Time: 2020-01-04
Author: honnibal+gh@gmail.com
File Name: thinc/layers/lstm.py
Class Name:
Method Name: LSTM_step


Project Name: explosion/thinc
Commit Name: a392ddaeae3a8343a968c8839afeea70b6f3a8b8
Time: 2020-01-04
Author: honnibal+gh@gmail.com
File Name: thinc/layers/recurrent.py
Class Name:
Method Name: recurrent


Project Name: XifengGuo/CapsNet-Keras
Commit Name: 37f599f61067cc6947c9bf783eace05227c0f450
Time: 2017-11-13
Author: guoxifeng1990@163.com
File Name: capsulenet.py
Class Name:
Method Name: CapsNet