for (int i = 0; i < layers; i++) {
MatrixWritable mv = new MatrixWritable();
mv.readFields(in);
array[i] = mv.getMatrix();
}
ActivationFunction func = null;
try {
func = (ActivationFunction) Class.forName(in.readUTF()).newInstance();
} catch (InstantiationException | IllegalAccessException
| ClassNotFoundException e) {
throw new RuntimeException(e);