コード例 #1
0
ファイル: config.py プロジェクト: TuckerBMorgan/catalyst
 def _get_callback(**params):
     wrapper_params = params.pop("_wrapper", None)
     callback = CALLBACKS.get_from_params(**params)
     if wrapper_params is not None:
         wrapper_params["base_callback"] = callback
         return ConfigExperiment._get_callback(**wrapper_params)
     return callback
コード例 #2
0
    def get_callbacks(self, stage: str) -> "List[Callback]":
        callbacks_params = (self.stages_config[stage].get(
            "callbacks_params", {}))

        callbacks = []
        for key, callback_params in callbacks_params.items():
            callback = CALLBACKS.get_from_params(**callback_params)
            callbacks.append(callback)

        return callbacks
コード例 #3
0
    def get_callbacks(self, stage: str) -> "OrderedDict[Callback]":
        callbacks_params = (self.stages_config[stage].get(
            "callbacks_params", {}))

        callbacks = OrderedDict()
        for key, callback_params in callbacks_params.items():
            callback = CALLBACKS.get_from_params(**callback_params)
            callbacks[key] = callback

        return callbacks