utils
This module contains utility functions for the models.
compute_kernel_bias(vecs)
vecs shape is (batch_size, max_seq_len, hidden_size) Calculate Kernel & Bias for the final transformation - y = (x + bias).dot(kernel)
Source code in src/models/utils.py
29 30 31 32 33 34 35 36 37 38 39 | |
normalize(vecs)
Standardization
Source code in src/models/utils.py
22 23 24 25 26 | |
transform_and_normalize(vecs, kernel, bias)
Applying transformation then standardize
Source code in src/models/utils.py
11 12 13 14 15 16 17 18 19 | |