All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nd4j.linalg.api.activation.Sigmoid Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.nd4j.linalg.api.activation;


import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.ops.ElementWiseOp;

/**
 * Sigmoid function (complex AND real!)
 *
 * http://www.kurims.kyoto-u.ac.jp/~kyodo/kokyuroku/contents/pdf/1742-18.pdf
 *
 * For complex we set the k = 1
 *
 *
 * @author Adam Gibson
 */
public class Sigmoid extends BaseActivationFunction {


    /**
     *
     */
    private static final long serialVersionUID = -6280602270833101092L;
    private int k = 1;



    /**
     * The class used for transformation
     *
     * @return the class used for transformation
     */
    @Override
    public Class transformClazz() {
        return org.nd4j.linalg.ops.transforms.Sigmoid.class;
    }

    @Override
    public INDArray applyDerivative(INDArray input) {
        INDArray rSub = input.rsub(1);
        return input.mul(rSub);
    }



}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy