Learn R Programming

nn2poly: Transforming Neural Networks into Polynomials

The nn2poly package implements the NN2Poly method that allows to transform an already trained deep feed-forward fully connected neural network into a polynomial representation that predicts as similar as possible to the original neural network. The obtained polynomial coefficients can be used to explain features (and their interactions) importance in the neural network, therefore working as a tool for interpretability or eXplainable Artificial Intelligence (XAI).

Related Papers:

  • Pablo Morala, J. Alexandra Cifuentes, Rosa E. Lillo, Iñaki Ucar (2021). "Towards a mathematical framework to inform neural network modelling via polynomial regression." Neural Networks, 142, 57-72. doi: 10.1016/j.neunet.2021.04.036

  • Pablo Morala, J. Alexandra Cifuentes, Rosa E. Lillo, Iñaki Ucar (2023). "NN2Poly: A Polynomial Representation for Deep Feed-Forward Artificial Neural Networks." IEEE Transactions on Neural Networks and Learning Systems, (Early Access). doi: 10.1109/TNNLS.2023.3330328

Installation

The installation from GitHub requires the remotes package.

# install.packages("remotes")
remotes::install_github("IBiDat/nn2poly")

Copy Link

Version

Install

install.packages('nn2poly')

Monthly Downloads

453

Version

0.1.1

License

MIT + file LICENSE

Maintainer

Pablo Morala

Last Published

January 30th, 2024

Functions in nn2poly (0.1.1)

luz_model_sequential

Build a luz model composed of a linear stack of layers
predict.nn2poly

Predict method for nn2poly objects.
nn2poly

Obtain polynomial representation
plot.nn2poly

Plot method for nn2poly objects.
plot_taylor_and_activation_potentials

Plots activation potentials and Taylor expansion.
plot_diagonal

Plots a comparison between two sets of points.
reexports

Objects exported from other packages
add_constraints

Add constraints to a neural network
eval_poly

Polynomial evaluation