I want to compute e^(ax+b) over a=-1:1 and b=-1:1 for various values of X. I want the output in the form a list of 5 elements. Each elemen
e^(ax+b) over a=-1:1
b=-1:1
X
In this case, you should only vectorize the variable x.
x
sigm1 = Vectorize(function(a=-1:1,b=-1:1,x){ outer(a,b,sigm,x)}, vectorize.args = "x" ,SIMPLIFY = FALSE)
Then running sigm1(-1:1,-1:1,1:3) will gives the result you want.
sigm1(-1:1,-1:1,1:3)