code: public static Class findActualFieldClass(Class clz, Field f) {
      // schema.getClass().getGenericSuperclass() instanceof ParameterizedType
      Type generic_type = f.getGenericType();
      if (! (generic_type instanceof TypeVariable))
        return f.getType();
  
      // field is a parameterized type
      // ((TypeVariable)schema.getClass().getField("parameters").getGenericType())
      TypeVariable[] tvs = clz.getSuperclass().getTypeParameters();
      TypeVariable tv = (TypeVariable)generic_type;
      String type_param_name = tv.getName();
  
      int which_tv = -1;
      for(int i = 0; i < tvs.length; i++)
        if (type_param_name.equals(tvs[i].getName()))
          which_tv = i;
  
      if (-1 == which_tv) {
        // We topped out in the type heirarchy, so just use the type from f.
        // E.g., this happens when getting the metadata for the parameters field of ModelSchemaV3.
        // It has no generic parent, so we need to use the base class.
          return f.getType();
      }
  
      ParameterizedType generic_super = (ParameterizedType)clz.getGenericSuperclass();
  
      if (generic_super.getActualTypeArguments()[which_tv] instanceof Class)
        return (Class)generic_super.getActualTypeArguments()[which_tv];
      return findActualFieldClass(clz.getSuperclass(), f);
    }
docs: Reflection helper which returns the actual class for a field which has a parameterized type.
  E.g., DeepLearningV2's "parameters" class is in parent ModelBuilderSchema, and is parameterized
  by type parameter P.