Skip to main content

Common Framework for Inference

Project description

CoFI (Common Framework for Inference)

PyPI version Python versions build Documentation Status codecov Slack

Introduction

CoFI (Common Framework for Inference) is an open-source initiative for interfacing between generic inference algorithms and specific geoscience problems.

With a mission to bridge the gap between the domain expertise and the inference expertise, this Python package provides an interface across a wide range of inference algorithms from different sources, as well as ways of defining inverse problems with examples included here.

This project and documentation are under initial development stage. Please feel free to contact us for feedback or issues!

Installation

It's optional, but recommended to use a virtual environment:

conda create -n cofi_env python=3.8 scipy
conda activate cofi_env

Install cofi with:

pip install cofi

Basic Usage

CoFI API has flexible ways of defining an inversion problem. For instance:

from cofi import BaseProblem

inv_problem = BaseProblem()
inv_problem.set_objective(my_objective_func)

Once a problem is defined, cofi can tell you what inference solvers you can use based on what level of information you've provided:

inv_problem.suggest_solvers()   # a list will be printed

Run an inversion with these lines:

from cofi import InversionOptions, Inversion

inv_options = InversionOptions()
inv_options.set_solving_method("optimisation")
inv_options.set_iteration_limit(100)

inv = Inversion(inv_problem, inv_options)
result = inv.run()
print(result.ok)
print(result.model)

And now an inversion is completed! Check out our example gallery and tutorial pages for more advanced usages.

Contributing

Interested in contributing? Please check out our contributor's guide.

License

This project is distributed under a 2-clause BSD license. A copy of this license is provided with distributions of the software.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cofi-0.1.2.dev0.tar.gz (815.8 kB view details)

Uploaded Source

File details

Details for the file cofi-0.1.2.dev0.tar.gz.

File metadata

  • Download URL: cofi-0.1.2.dev0.tar.gz
  • Upload date:
  • Size: 815.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for cofi-0.1.2.dev0.tar.gz
Algorithm Hash digest
SHA256 8fc39ad20b0e0af444000d580ae7f0a3eb7fbb5368c44ea80ec02865f449eeed
MD5 406e565c6240b3d07a2e5ed66353af0a
BLAKE2b-256 00f27d0964d29b01389efac8c568973602c29303721846a83e14900d92dd11a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page