Ladies and gentlemen, I'm trying to use the AMORE package of R to run a Neural Network with new activation functions, but I could not understand the manual very well and consequently I was not able to 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 the 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)
If someone has already used or has any tips to give me, I am grateful for the help.
Sincerely, Elisalvo