ciir.umass.edu.learning.neuralnet.HyperTangentFunction Maven / Gradle / Ivy
The newest version!
/*===============================================================================
* Copyright (c) 2010-2012 University of Massachusetts. All Rights Reserved.
*
* Use of the RankLib package is subject to the terms of the software license set
* forth in the LICENSE file included with this software, and also available at
* http://people.cs.umass.edu/~vdang/ranklib_license.html
*===============================================================================
*/
package ciir.umass.edu.learning.neuralnet;
/**
* @author vdang
*/
public class HyperTangentFunction implements TransferFunction {
@Override
public double compute(final double x) {
return 1.7159 * Math.tanh(x * 2 / 3);
}
@Override
public double computeDerivative(final double x) {
final double output = Math.tanh(x * 2 / 3);
return 1.7159 * (1.0 - output * output) * 2 / 3;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy