Welcome to CoFI!

Welcome to CoFI!#

Welcome to the CoFI Documentation! CoFI, the Common Framework for Inference, is an open-source tool that bridges the gap between domain expertise and inference, within and beyond the field of geoscience.

Whether youโ€™re a student, an educator, or an industry professional, CoFI is your go-to tool. It simplifies the process of applying inference techniques, allowing for a wide range of applications from academic research and teaching to solving real-world geoscience problems in the industry. With its user-friendly, flexible and accessible interface, CoFI empowers you to focus on what truly matters - the science.

graph TD; cofi(CoFI - Common Framework for Inference):::cls_cofi; parameter_estimation(Parameter estimation):::cls_parameter_estimation; linear(Matrix based solvers):::cls_parameter_estimation; non_linear(Optimization):::cls_parameter_estimation; linear_system_solvers(Linear system solvers):::cls_parameter_estimation; linear_solverlist(scipy.linalg.lstsq <br>...):::cls_solvers; optimization(Non linear):::cls_parameter_estimation; optimization2(Linear):::cls_parameter_estimation; opt_solverlist(scipy.optimize.minimize <br> torch.optim <br> ROL <br>...):::cls_solvers; ensemble_methods(Ensemble methods):::cls_ensemble_methods; direct_search(Direct Search):::cls_ensemble_methods; amc(Monte Carlo):::cls_ensemble_methods; amc_solverlist(Neighbourhood Algorithm <br> Bayesian Optimization <br> Slime mold algorithm <br> Border Collie Optimization <br> ...):::cls_solvers; ng(Deterministic):::cls_ensemble_methods; ng_solverlist(Nested grids <br> Hilbert Curves<br>...):::cls_solvers; bs(Bayesian Sampling):::cls_ensemble_methods; mcmc(McMC samplers):::cls_ensemble_methods; mcmc_solverlist(Basic metropolis<br>Affine Invariance sampler<br>emcee <br> pyMC <br> ...):::cls_solvers; rjmcmc(Trans-D McMC):::cls_ensemble_methods; rjmcmc_solverlist(Basic Trans-D <br> BayesBay <br> RJ-mcmc):::cls_solvers; cofi --> parameter_estimation; parameter_estimation --> linear; linear --> linear_system_solvers; linear_system_solvers -.- linear_solverlist; parameter_estimation --> non_linear; non_linear --> optimization; non_linear --> optimization2; optimization -.- opt_solverlist; optimization2 -.- opt_solverlist; cofi --> ensemble_methods; ensemble_methods --> direct_search; direct_search --> amc; amc -.- amc_solverlist; direct_search --> ng; ng -.- ng_solverlist; ensemble_methods --> bs; bs --> mcmc; mcmc -.- mcmc_solverlist; bs --> rjmcmc; rjmcmc -.- rjmcmc_solverlist; classDef cls_cofi fill: #d4a373, stroke-width:0; classDef cls_parameter_estimation fill: #ccd5ae, stroke-width:0; classDef cls_ensemble_methods fill: #e9edc9, stroke-width:0; classDef cls_solvers fill: #faedcd, stroke-width:0;
 1# CoFI API has flexible ways of defining an inversion problem. For instance:
 2import cofi
 3
 4inv_problem = cofi.BaseProblem()
 5inv_problem.set_objective(my_objective_func)
 6inv_problem.set_initial_model(my_starting_point)
 7
 8# Once a problem is defined, `cofi` can tell you what inference tools you can
 9# use based on what level of information you've provided:
10inv_problem.suggest_tools()   # a tree will be printed
11
12# Run an inversion with these lines:
13inv_options = cofi.InversionOptions()
14inv_options.set_tool("torch.optim")
15inv_options.set_params(options={"num_iterations": 50, "algorithm": "Adam"})
16
17inv = cofi.Inversion(inv_problem, inv_options)
18result = inv.run()
19print(result.success)
20print(result.model)

If this looks useful, letโ€™s get started!

โ˜•๏ธ Installation

Get a CoFI from here

๐Ÿ“– Tutorials

Step-by-step guide on how to use CoFI

๐Ÿ—‚๏ธ Examples

Adapt a real-world application to your needs

๐Ÿ“— API Reference

Dive into the details

๐Ÿ—๏ธ Development

Report issues or contribute with your code

๐Ÿ’ฌ Have questions?

Accept this invitation to join the conversation on Slack

CoFI is currently supported and coordinated by InLab.