use of org.gitia.froog.transferfunction.TransferFunction in project froog by mroodschild.
the class TansigTest method testDerivativeParam.
/**
* Test of derivative method, of class Tansig.
*/
@Test
public void testDerivativeParam() {
TransferFunction tansig = FunctionFactory.getFunction("tansig");
SimpleMatrix a = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
double[] salida = tansig.derivative(a, 0.1).getMatrix().getData();
double[] esperado = { 0.94375000, 0.99100000, 1.00000000, 0.96400000, 0.77500000 };
assertArrayEquals(esperado, salida, 0.000000001);
}
use of org.gitia.froog.transferfunction.TransferFunction in project froog by mroodschild.
the class TansigTest method testDerivativeOutput.
/**
* Test of derivative method, of class Tansig.
*/
@Test
public void testDerivativeOutput() {
TransferFunction tansig = FunctionFactory.getFunction("tansig");
SimpleMatrix yCalc = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
SimpleMatrix yObs = new SimpleMatrix(1, 5, true, -0.10, 0.05, 0.15, 0.35, 0.65);
// SimpleMatrix a = new SimpleMatrix(1, 5, true, -3, -1, 0, 1, 3);
double[] salida = tansig.derivative(yCalc, yObs).getMatrix().getData();
double[] esperado = { -0.140625, -0.1485, -0.15, -0.144, -0.1125 };
assertArrayEquals(esperado, salida, 0.000000001);
}
use of org.gitia.froog.transferfunction.TransferFunction in project froog by mroodschild.
the class TansigTest method testDerivative.
/**
* Test of derivative method, of class Tansig.
*/
@Test
public void testDerivative() {
TransferFunction tansig = FunctionFactory.getFunction("tansig");
SimpleMatrix a = new SimpleMatrix(1, 5, true, -0.25, -0.1, 0, 0.2, 0.5);
double[] salida = tansig.derivative(a).getMatrix().getData();
double[] esperado = { 0.9375, 0.99, 1, 0.96, 0.75 };
assertArrayEquals(esperado, salida, 0.000000001);
}
Aggregations