(span, length)
| 29 | return np.exp(-np.logaddexp(0, -x)) |
| 30 | |
| 31 | def gen_position_indicator(span, length): |
| 32 | indicator = [0] * length |
| 33 | for idx, i in enumerate(range(span[0], -1, -1)): |
| 34 | indicator[i] = -idx |
| 35 | for idx, i in enumerate(range(span[1], length)): |
| 36 | indicator[i] = idx + 1 |
| 37 | return indicator |
| 38 | |
| 39 | def indicator_vector(index, length, default_label=0, indicator_label=1, head_index=None): |
| 40 | vector = [default_label] * length |
nothing calls this directly
no outgoing calls
no test coverage detected