Search in sources :

Example 1 with Sigmoid

use of org.nd4j.linalg.api.ops.impl.transforms.Sigmoid in project nd4j by deeplearning4j.

the class SameDiffOpExecutionerTest method testupdateGraphFromProfiler.

@Test
public void testupdateGraphFromProfiler() {
    SameDiffOpExecutioner sameDiffOpExecutioner = new SameDiffOpExecutioner();
    Nd4j.getExecutioner().setProfilingMode(OpExecutioner.ProfilingMode.ALL);
    Nd4j.getExecutioner().exec(new Sigmoid(Nd4j.scalar(1.0)));
    SameDiff sameDiff = sameDiffOpExecutioner.getSameDiff();
}
Also used : SameDiff(org.nd4j.autodiff.samediff.SameDiff) SameDiffOpExecutioner(org.nd4j.autodiff.samediff.SameDiffOpExecutioner) Sigmoid(org.nd4j.linalg.api.ops.impl.transforms.Sigmoid) Test(org.junit.Test)

Example 2 with Sigmoid

use of org.nd4j.linalg.api.ops.impl.transforms.Sigmoid in project nd4j by deeplearning4j.

the class ActivationSoftPlus method backprop.

@Override
public Pair<INDArray, INDArray> backprop(INDArray in, INDArray epsilon) {
    INDArray dLdz = Nd4j.getExecutioner().execAndReturn(new Sigmoid(in));
    dLdz.muli(epsilon);
    return new Pair<>(dLdz, null);
}
Also used : INDArray(org.nd4j.linalg.api.ndarray.INDArray) Sigmoid(org.nd4j.linalg.api.ops.impl.transforms.Sigmoid) Pair(org.nd4j.linalg.primitives.Pair)

Aggregations

Sigmoid (org.nd4j.linalg.api.ops.impl.transforms.Sigmoid)2 Test (org.junit.Test)1 SameDiff (org.nd4j.autodiff.samediff.SameDiff)1 SameDiffOpExecutioner (org.nd4j.autodiff.samediff.SameDiffOpExecutioner)1 INDArray (org.nd4j.linalg.api.ndarray.INDArray)1 Pair (org.nd4j.linalg.primitives.Pair)1