Custom transfer function much slower than standard transfer functions
Ältere Kommentare anzeigen
Hi,
I needed to define a custom transfer function for a custom neural network I am building, more specifically a negative exponetial transfer function a = exp(n).
I followed the instructions of the documentation and it does work, in principle. The problem is that it is A LOT slower than the standard transfer functions.
I started investigating this and put breakpoints in the code of other transfer funcions (in /usr/local/MATLAB/R2012b/toolbox/nnet/nntransfer). The debugger does not break at these points. It seems like the neural network toolbox is using some compiled versions of the transfer functions.
How can I do the same with my custom transfer function?
The speed at which it is currently working makes it unusable for me.
Thanks for your help, it is very much appreciated! Rico
Antworten (1)
Greg Heath
am 19 Dez. 2013
Bearbeitet: Greg Heath
am 19 Dez. 2013
Just modify the code for radbas.
type radbas
Thank you for formally accepting my answer.
Greg
4 Kommentare
Rico
am 19 Dez. 2013
Greg Heath
am 19 Dez. 2013
Bearbeitet: Greg Heath
am 19 Dez. 2013
Yes. However, it is not clear if you have ever modified a working code instead of writing your own.
Rico
am 6 Jan. 2014
Andreas Walker
am 17 Feb. 2021
Sorry for bringing up again such an old thread, but an actual answer would be really helpful.
I have two neural networks doing roughly the same (same input-output structure, solving a regression task). One uses built-in transfer functions and has about 250 layers (network 1). The other one uses some custom transfer functions and has about 60 layers (network 2). I created the custom function by copying the framework around an existing transfer function to the working directory and adapted names & functions.
Network 2 fits the data much, much better. Hence I want to use this network. However, a call to sim(net, ...) takes about 7 (!) times longer on network 2 than on network 1. Why is this the case and how can I make network 2 faster?
Kategorien
Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!