def __init__(self, optimizer, *args): """The processing worker for model fitting. Use this if you want to use the model processing strategy to do model fitting. Args: optimizer: the optimization routine to use """ super(FittingProcessingWorker, self).__init__(*args) self._optimizer = optimizer self._write_volumes_gzipped = gzip_optimization_results()
def __init__(self, optimizer, model, mask, nifti_header, output_dir, tmp_storage_dir, recalculate): """The processing worker for model fitting. Use this if you want to use the model processing strategy to do model fitting. Args: optimizer: the optimization routine to use """ super(FittingProcessor, self).__init__(mask, nifti_header, output_dir, tmp_storage_dir, recalculate) self._model = model self._optimizer = optimizer self._write_volumes_gzipped = gzip_optimization_results() self._subdirs = set()
def __init__(self, method, model, mask, nifti_header, output_dir, tmp_storage_dir, recalculate, optimizer_options=None): """The processing worker for model fitting. Use this if you want to use the model processing strategy to do model fitting. Args: method: the optimization routine to use """ super().__init__(mask, nifti_header, output_dir, tmp_storage_dir, recalculate) self._model = model self._method = method self._optimizer_options = optimizer_options self._write_volumes_gzipped = gzip_optimization_results() self._subdirs = set() self._logger=logging.getLogger(__name__)
def __init__(self, method, model, mask, nifti_header, output_dir, tmp_storage_dir, recalculate, optimizer_options=None): """The processing worker for model fitting. Use this if you want to use the model processing strategy to do model fitting. Args: method: the optimization routine to use """ super().__init__(mask, nifti_header, output_dir, tmp_storage_dir, recalculate) self._model = model self._method = method self._optimizer_options = optimizer_options self._write_volumes_gzipped = gzip_optimization_results() self._subdirs = set() self._logger = logging.getLogger(__name__) self._cl_runtime_info = CLRuntimeInfo() self._codec = self._model.get_mle_codec() self._initial_params = self._model.get_initial_parameters() self._wrapper = ParameterDecodingWrapper( self._model.get_nmr_parameters(), self._codec.get_decode_function()) self._kernel_data = self._model.get_kernel_data() self._lower_bounds, self._upper_bounds = self._codec.encode_bounds( self._model.get_lower_bounds(), self._model.get_upper_bounds()) self._objective_func = self._wrapper.wrap_objective_function( self._model.get_objective_function()) self._constraints_func = self._wrapper.wrap_constraints_function( self._model.get_constraints_function())