nimble.loadTrainedLearner

nimble.loadTrainedLearner(source, arguments=None, *, useLog=None, **kwarguments)

Load nimble TrainedLearner object.

Parameters:
  • source (file, str) –

    • open file-like object

    • string path or url to the data file.

    • string name in the form ‘package.learner’ where learner is the name of a pre-trained learner available in the given package.

  • arguments (dict) – Mapping argument names (strings) to their values, to be used during loading and application (e.g., {‘include_top’:True}). To provide an argument that is an object from the same package as the learner, use a nimble.Init object with the object name and its instantiation arguments (e.g., {‘classifier_activation’: nimble.Init(‘relu’, alpha=0.1}). Note: learner arguments can also be passed as kwarguments so this dictionary will be merged with any keyword arguments.

  • useLog (bool, None) – Local control for whether to send object creation to the logger. If None (default), use the value as specified in the “logger” “enabledByDefault” configuration option. If True, send to the logger regardless of the global option. If False, do NOT send to the logger, regardless of the global option.

  • kwarguments – Keyword arguments specified variables that are passed to the learner. These are combined with the arguments parameter. To provide an argument that is an object from the same package as the learner, use a nimble.Init object with the object name and its instantiation arguments (e.g., classifier_activation=nimble.Init(‘relu’, alpha=0.1)).

Returns:

TrainedLearner

Keywords: open, import, model, pretrained, transfer learning