Here are the examples of the java api cn.centipede.numpy.Numpy.np.exp() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
16
Source : LossFunction.java
with MIT License
from DRL-CASIA
with MIT License
from DRL-CASIA
public static NDArray Softmax_cross_loss(NDArray y_pre, NDArray y) {
NDArray softmax = np.exp(y_pre).divide(np.sum(np.exp(y_pre), 0));
// loss = - np.sum(y * np.log(softmax))
NDArray loss = softmax.subtract(y);
return loss;
}
16
Source : Tanh.java
with MIT License
from DRL-CASIA
with MIT License
from DRL-CASIA
@Override
public NDArray forward(NDArray x) {
NDArray ex = np.exp(x);
NDArray ex_ = np.exp(x.negative());
this.x = ex.subtract(ex_).divide(ex.add(ex_));
return this.x;
}