implement opengm learning functions