I have a simple neural network in Keras with 16 inputs and 1 output. I want to be able to find out which of these inputs is the most important in determining the output (i.e. varying which input would affect the output the most). How can I do that in Keras or TensorFlow? I know I can dump the weights of the trained neural network into a file, but that won't help as the weights are just from one node to another in the next hidden layer.ThanksXtrain, Xtest, Ytrain, Ytest = train_test_split(X, Y, test_size=.5)model = Sequential()model.add(Dense(20, activation='relu', input_dim=16))model.add(Dense(10, activation='relu'))model.add(Dense(5, activation='relu'))model.add(Dense(1, activation='relu'))model.compile(loss='mse', optimizer='rmsprop')model.fit(Xtrain, Ytrain, validation_data=(Xtest,Ytest), epochs=200, batch_size=100, verbose=1)Ypred = model.predict(Xtest)
Adding weights per input (of connections to next layer) may be a start. Negative weights also signify influence.