I want to get value of an exponential function to my code, but I don't know how to code to exponential functions in Java. What is the way to code exponential functions in Java?
public class Demo {
// inputs are declared
private int x[] = {1, 0, 1, 0};
//weights are declared
private double w[] = {0.4, 0.6, 0.7, 0.8};
private double temp = 0;
private double z = 0;
private int desiredOutput[] = {0, 1, 1, 1};
private double sigmoidOutput[] = {1, 1, 1, 1};
public void calculate() {
for(int i =0; i < 4; i++) {
temp = x[i] * w[i];
z += temp;
}
/*
I want to get the value of 1/(1+e to the power (-z) )
*/
}
}