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:
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.
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
nn2polyfunction, 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:
localwith default value ofFALSEto keep the current global behavior in general.localis set toTRUEthe function will need an optional argument to be the observation vector.alg_non_linearare done in a single pass for the whole layer, so we would need to have thetaylor_centerparameter 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.