Skip to content

Local version of nn2poly #83

Description

@moralapablo

Once #82 is implemented, we could start an experimental local version of NN2Poly.

The main idea would be to use the method with a given observation, and therefore being able to compute the specific point where taylor expansion should be applied at each activation function instead of doing it at a given point for the whole network. This would require adding new parameters to the nn2poly function, as now it would need to use the activation potentials of a given observation over the whole network, as well as the chosen observation itslef.

The required changes are:

  • Add the option to choose between local or global nn2poly. Probably we could set an argument named local with default value of FALSE to keep the current global behavior in general.
  • When local is set to TRUE the function will need an optional argument to be the observation vector.
  • Then, before entering the actual nn2poly algorithm, we need to compute the activation potentials at each neuron for that observation. This could be done in 2 ways:
    • If the user is providing a neural network in one of the suported frameworks, the most efficient way would be to compute use that framework to extract the activation potentials
    • If the user is providing just the weights as matrices and the activation functions, then we would have to compute the activation potentials with a custom function mimicking the computations of a neural network.
  • Once the activation potentials are computed, they should be provided as a new optional argument in the nn2poly algorithm
  • This activation potentials will control the chosen Taylor expansion center, as implemented in Allow Taylor expansion at given point, not only zero #82. However, in this case we have a taylor expansion center per neuron, and if I'm not mistaken the computations in the current version of alg_non_linear are done in a single pass for the whole layer, so we would need to have the taylor_center parameter used as a vector with the specific value for each neuron in the layer. Also, the derviatives computed in the taylor expansion should also be in some matrix form where each row are the taylor derivatives for each neuron.

Then, the final result would be a polynomial as usually in nn2poly, but specifically taylored for a given observation. Computing then the effect of each monomial with the polynomial and the observation values should give more accurate importances for the chosen observation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions