public static IActivationFunction ParseActivationFunction(
IDictionary<String, String> paras, String name)
{
String v;
try
{
v = paras[name];
if (v == null)
{
throw new PersistError("Missing property: " + name);
}
IActivationFunction af;
String[] cols = v.Split('|');
String afName = ReflectionUtil.AfPath
+ cols[0];
try
{
af = (IActivationFunction) ReflectionUtil.LoadObject(afName);
}
catch (Exception e)
{
throw new PersistError(e);
}
for (int i = 0; i < af.ParamNames.Length; i++)
{
af.Params[i] = CSVFormat.EgFormat.Parse(cols[i + 1]);
}
return af;
}
catch (Exception ex)
{
throw new PersistError(ex);
}
}