Exp-Centered Units (ExU): PyTorch Architecture

Navigation:

Overview & Formula Tokens

Exp-Centered Units are an activation of the neural effect, selected with activation='exu':

# Exp-Centered Units (ExU) inside NeuralEffect for sharp discontinuities
formula = "Y ~ n(x1, others='x2', activation='exu', n_neurons=32)"

Parameter Specification

ExU is selected through n(..., activation='exu'); the other parameters are those of the neural effect (see NEURAL.md).

Complexity & Performance

  • Same cost as the neural effect it extends; the other activations are unchanged.

State, Complexity and Limits

  • Class and file: NeuralEffect (src/tam/model/spectrum/_neural.py) with activation='exu'. Label: (BETA).

  • State: none. Other activations: unchanged, bit for bit.

Code

Parsing of the n(...) token in the factory:

        elif ttype == 'n':
            n_neurons = int(params_resolved.get('n_neurons', 500))
            act = params_resolved.get('act', 'relu')
            seed = int(params_resolved.get('seed', 42))
            n_hidden_layers = int(params_resolved.get('n_hidden_layers', 1))
            others_str = params_resolved.get('others', None)
            additional_features = None
            if others_str:
                additional_features = [s.strip() for s in others_str.split('|') if s.strip()]
            extrap_val = params_resolved.get('extrapolate', 'linear')
            effects_list.append(NeuralEffect(feature_name, n_neurons, act, lambda_p, additional_features, seed, n_hidden_layers, extrap_val))
            effects_list[-1].orthogonalize = _as_bool(params_resolved.get('orthogonalize', False))