public static XYDataset createDataset(ActivationFunction activation, boolean normal) {
XYSeriesCollection dataset = new XYSeriesCollection();
if( normal )
{
Function2D n1 = new ActivationFunction2D(activation);// //new NormalDistributionFunction2D(0.0, 1.0);
XYSeries s1 = DatasetUtilities.sampleFunction2DToSeries(n1, -5.1, 5.1,
121, "Activation Function");
dataset.addSeries(s1);
}
else
{
if( activation.hasDerivative())
{
Function2D n2 = new DerivativeFunction2D(activation);
XYSeries s2 = DatasetUtilities.sampleFunction2DToSeries(n2, -5.1, 5.1,
121, "Derivative Function");
dataset.addSeries(s2);
}
}