flat.setActivationFunctions(new ActivationFunction[flat
.getLayerCounts().length]);
for (final String line : section.getLines()) {
ActivationFunction af = null;
final List<String> cols = EncogFileSection
.splitColumns(line);
// if this is a class name with a path, then do not default to inside of the Encog package.
String name;
if( cols.get(0).indexOf('.')!=-1 ) {
name = cols.get(0);
} else {
name = "org.encog.engine.network.activation."
+ cols.get(0);
}
try {
final Class<?> clazz = Class.forName(name);
af = (ActivationFunction) clazz.newInstance();
} catch (final ClassNotFoundException e) {
throw new PersistError(e);
} catch (final InstantiationException e) {
throw new PersistError(e);
} catch (final IllegalAccessException e) {
throw new PersistError(e);
}
for (int i = 0; i < af.getParamNames().length; i++) {
af.setParam(i,
CSVFormat.EG_FORMAT.parse(cols.get(i + 1)));
}
flat.getActivationFunctions()[index++] = af;
}