|
X_len = np.array([len(x) for x in X]).sum() |
Here X_len corresponds to the number of sequences and not consider feature dimensionality. In the following lines, mean is calculated by first summing all entries and then dividing by the X_len, assuming that it is total number of entries.