4
Dear colleagues, I am trying to use the AMORE package of R to run a Neural Network with new activation functions, but I could not understand very well the manual and consequently could not implement the new function. Anyway, the function I want to implement is as follows::
Ordonez
ord <- function(x){
1-((1+0.5*exp(x))^(-1/0.5))#activation function Aranda-Ordonez
}
DERIVATIVE Ordonez
dord <- function(x){
((1+0.5*exp(x))^(-(1+0.5)/0.5))*exp(x)# derivative activation functionao Aranda-Ordonez
}
and the function of R that I want to use is this, which I just want to modify the function of the last neuron output.layer="custom"
:
select.activation.function(activation.function)
library(AMORE)
P <- matrix(sample(seq(-1,1,length=1000), 1000, replace=FALSE), ncol=1)
target <- P^2
net <- newff(n.neurons=c(1,3,2,1), learning.rate.global=1e-2, momentum.global=0.5,
error.criterium="LMS", Stao=NA, hidden.layer="tansig",
output.layer="custom", method="ADAPTgdwm")
result <- train(net, P, target, error.criterium="LMS", report=TRUE, show.step=100, n.shows=5 )
y <- sim(result$net, P)
In case anyone has ever used or has any tips to give me, I’m grateful for the help.
Sincerely yours truly, Elisalvo
I came to this question just for lack... :/
– CypherPotato