@classmethod
def extract(cls, node):
    pb = node.parameters
    collect_until_token(pb, b'<MaxChange>')
    max_change = read_binary_float_token(pb)
    collect_until_token(pb, b'<L2Regularize>')
    collect_until_token(pb, b'<LearningRate>')
    collect_until_token(pb, b'<TimeOffsets>')
    time_offsets = read_binary_vector(pb, False, np.int32)
    collect_until_token(pb, b'<LinearParams>')
    (weights, weights_shape) = read_binary_matrix(pb)
    collect_until_token(pb, b'<BiasParams>')
    bias_params = read_binary_vector(pb)
    collect_until_token(pb, b'<OrthonormalConstraint>')
    orthonormal_constraint = read_binary_float_token(pb)
    collect_until_token(pb, b'<UseNaturalGradient>')
    use_natural_grad = read_binary_bool_token(pb)
    collect_until_token(pb, b'<NumSamplesHistory>')
    num_samples_hist = read_binary_float_token(pb)
    collect_until_token(pb, b'<AlphaInOut>')
    alpha_in_out = (read_binary_float_token(pb), read_binary_float_token(pb))
    collect_until_token(pb, b'<RankInOut>')
    rank_in_out = (read_binary_integer32_token(pb), read_binary_integer32_token(pb))
    biases = (mo_array(bias_params) if (len(bias_params) != 0) else None)
    attrs = {'weights': np.reshape(weights, weights_shape), 'biases': biases, 'time_offsets': time_offsets}
    TdnnComponent.update_node_stat(node, attrs)
    return cls.enabled
@classmethod
def extract(cls, node):
    pb = node.parameters
    collect_until_token(pb, b'<MaxChange>')
    max_change = read_binary_float_token(pb)
    collect_until_token(pb, b'<L2Regularize>')
    collect_until_token(pb, b'<LearningRate>')
    collect_until_token(pb, b'<TimeOffsets>')
    time_offsets = read_binary_vector(pb, False, np.int32)
    collect_until_token(pb, b'<LinearParams>')
    (weights, weights_shape) = read_binary_matrix(pb)
    collect_until_token(pb, b'<BiasParams>')
    bias_params = read_binary_vector(pb)
    collect_until_token(pb, b'<OrthonormalConstraint>')
    orthonormal_constraint = read_binary_float_token(pb)
    collect_until_token(pb, b'<UseNaturalGradient>')
    use_natural_grad = read_binary_bool_token(pb)
    collect_until_token(pb, b'<NumSamplesHistory>')
    num_samples_hist = read_binary_float_token(pb)
    collect_until_token(pb, b'<AlphaInOut>')
    alpha_in_out = (read_binary_float_token(pb), read_binary_float_token(pb))
    collect_until_token(pb, b'<RankInOut>')
    rank_in_out = (read_binary_integer32_token(pb), read_binary_integer32_token(pb))
    biases = (mo_array(bias_params) if (len(bias_params) != 0) else None)
    attrs = {'weights': np.reshape(weights, weights_shape), 'biases': biases, 'time_offsets': time_offsets}
    TdnnComponent.update_node_stat(node, attrs)
    return cls.enabled