MATLAB: How to generate mathematical model or equation of a Neural netwok converted by gensim o simulink

annann to simulinkDeep Learning Toolboxgensimmathematical equationmathematical modelMATLABmodel generatorsimulink

i have designed a custom neural network using commands available in NNTOOL. later i converted the ANN into simulink model using 'gensim'command..
Now i want to get the mathematical relation between the inputs and outputs that contains weight matrices, biases… I don't need a fixed equation with trained weight values.. any generalized relation with matrix names is sufficient.. please help me

Best Answer

I don't know about gensim/Simulink. However, the general equation for the standard MLP is
output = repmat(b2,1,N) + LW*tanh(repmat(b1,1,N)+ IW*input)
For outputs confined to [-1,1] or [0,1] just insert into
tansig(x) = tanh(x) = (exp(x)-exp(-x))./(exp(x)+ exp(-x))
or
logsig(x) = 1./(1+exp(-x) = (1/2)*(1+tanh(x))
respectively.
Hope this helps.
Thank you for formally accepting my answer
Greg