added sigmoid function

This commit is contained in:
ori agranat
2019-09-29 00:05:20 +03:00
parent 7a49541d45
commit 055194f9a7
2 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,15 @@
package com.chameleonvision.Handler;
import java.lang.Math;
public class MathHandler {
MathHandler(){}
public static double sigmoid(double x){
double bias = 0;
double a = 5;
double b = -0.05;
double k = 200;
if (x < 50){
bias = -1.339;
}
return ((k / (1 + Math.pow(Math.E,(a + (b * x))))) + bias);
}
}