Good Morning, I am using the neuralnet package in R, and am able to produce some basic neural nets, and use the output. I would like to exclude some of the weights and biases from the iteration process and fix their values. However I do not seem to be able to correctly define the exclude and constant.weights vectors. Question: Can someone point me to an example where exclude and contant.weights are used. I have search the R help archive, and haven't found any examples which use these on the web. Thank you in advance for any help. Sincerely Dan [[alternative HTML version deleted]]
Sebastian Mueller
2020-Oct-11 01:23 UTC
[R] Help using the exclude option in the neuralnet package
Hi Dan, the easiest way to declare `exclude` and `constant.weights` is as a vector of indices. You can determine the index of the neuron as follows: The layers are arranged in sequence, with the bias neuron being the first in each layer. So in a neural net with 6 input neurons and a layer of 3 hidden neurons, the bias neurons would be at indices 1 and 8. HTH. Sebastian