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

com.expleague.ml.func.generic.Sigmoid Maven / Gradle / Ivy

There is a newer version: 1.4.9
Show newest version
package com.expleague.ml.func.generic;

import com.expleague.commons.math.AnalyticFunc;
import com.expleague.commons.math.MathTools;

/**
* User: solar
* Date: 26.05.15
* Time: 11:45
*/
public class Sigmoid extends AnalyticFunc.Stub {
  @Override
  public double gradient(double x) {
    final double exp = Math.exp(-x);
    return exp > 1/ MathTools.EPSILON ? 0 : exp / (1 + exp) / (1 + exp);
  }

  @Override
  public double value(double x) {
    return 1./(1. + Math.exp(-x));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy