Is there a way of getting the formula for a trained neural network when using the TensorFlow library? I mean, if we want to deploy the way that the neural network calculates the output, how I can get the formula?
If you want to extract the biases and weights of the trained network to do a "manual" calculation this may be helpful:
https://www.youtube.com/watch?v=7PWgx16kH8s
But if you need to know the function that the network represents, it really depends on the selected architecture and functions.
In general, for feed-forward neural networks, the computing unit j (neuron j) formula is:
f(b + sum_i x_i w_{ij}) ,
where f is the selected activation function, x_i is the value of input neuron i, b is the bias, and w_{ij} the weight of the link from input neuron i to neuron j. The last two can be found using the method applied in the aforementioned youtube video.
Knowing this you can systematically build your formula from the input layer to the output layer.
Dear Riccardo Silini Riccardo, I have a topology in ns3, which is based on C++, and have designed a new protocol. The aim that I am following is to send the parameters from ns3 (C++) to the trained engine and get the output, then decided based on them. What is your suggestion for connecting these two platforms?
Dear Reza, sadly I'm not very familiar with your specific problem. You might want to create a new question on RG to see whether there is someone that could be of better help for it.