autofit.PySwarmsLocal#
- class autofit.PySwarmsLocal(name: Optional[str] = None, path_prefix: Optional[str] = None, unique_tag: Optional[str] = None, prior_passer=None, iterations_per_update: Optional[int] = None, number_of_cores: Optional[int] = None, session: Optional[Session] = None, **kwargs)[source]#
Bases:
AbstractPySwarmsA PySwarms Particle Swarm Optimizer global non-linear search.
For a full description of PySwarms, checkout its Github and readthedocs webpages:
https://github.com/ljvmiranda921/pyswarms
https://pyswarms.readthedocs.io/en/latest/index.html
- Parameters:
name – The name of the search, controlling the last folder results are output.
path_prefix – The path of folders prefixing the name folder where results are output.
unique_tag – The name of a unique tag for this model-fit, which will be given a unique entry in the sqlite database and also acts as the folder after the path prefix and before the search name.
prior_passer – Controls how priors are passed from the results of this NonLinearSearch to a subsequent non-linear search.
initializer – Generates the initialize samples of non-linear parameter space (see autofit.non_linear.initializer).
number_of_cores – The number of cores Emcee sampling is performed using a Python multiprocessing Pool instance. If 1, a pool instance is not created and the job runs in serial.
Methods
check_modelconfig_dict_with_test_mode_settings_fromcopy_with_pathsexact_fitfitFit a model, M with some function f that takes instances of the class represented by model M and gives a score for their fitness.
fit_sequentialFit multiple analyses contained within the analysis sequentially.
fitness_function_from_model_and_analysismake_poolMake the pool instance used to parallelize a NonLinearSearch alongside a set of unique ids for every process in the pool.
make_sneaky_poolCreate a pool for multiprocessing that uses slight-of-hand to avoid copying the fitness function between processes multiple times.
optimisePerform optimisation for expectation propagation.
perform_updatePerform an update of the non-linear search's model-fitting results.
perform_visualizationPerform visualization of the non-linear search's model-fitting results.
plot_resultsremove_state_filesGet the static Dynesty sampler which performs the non-linear search, passing it all associated input Dynesty variables.
samples_fromAttributes
config_dict_runA property that is only computed once per instance and then replaces itself with an ordinary attribute.
config_dict_searchA property that is only computed once per instance and then replaces itself with an ordinary attribute.
config_dict_settingsconfig_typeloggerLog 'msg % args' with severity 'DEBUG'.
namepathssamples_clstimer