Skip to main content

Common Framework for Inference

Project description

CoFI (Common Framework for Inference)

PyPI version Conda Version 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, CoFI provides an interface across a wide range of inference algorithms from different sources, underpinned by a rich set of domain relevant examples.

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

Installation

From PyPI:

$ pip install cofi

Or alternatively, from conda-forge:

$ conda install -c conda-forge cofi

Check CoFI documentation - installation page for details on dependencies and setting up with virtual environments.

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)
inv_problem.set_initial_model(my_starting_point)

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_tools()   # a tree will be printed

Run an inversion with these lines:

from cofi import InversionOptions, Inversion

inv_options = InversionOptions()
inv_options.set_solving_method("optimization")
inv_options.set_params(options={"maxiter":100})

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

And now an inversion is completed! Check out our example gallery and tutorial pages for more real-world or advanced use cases.

Contributing

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

Licence

This project is distributed under a 2-clause BSD licence. A copy of this licence 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.dev25.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cofi-0.1.2.dev25-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cofi-0.1.2.dev25.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for cofi-0.1.2.dev25.tar.gz
Algorithm Hash digest
SHA256 6f019bfa99a3297a7c76e289e77f5e8d78ac1ace885928c5fc5361ae944ee253
MD5 2f85bddbeea90cdd9716d5fc7a8337b4
BLAKE2b-256 d1e27eeb18fdface6cc4da18e265432a479730cf4f9ddf6a860a423c76402cd2

See more details on using hashes here.

File details

Details for the file cofi-0.1.2.dev25-py3-none-any.whl.

File metadata

  • Download URL: cofi-0.1.2.dev25-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for cofi-0.1.2.dev25-py3-none-any.whl
Algorithm Hash digest
SHA256 c446237aa10ae3868aacc8120d9f95d45bd4b7fb49d94499ceed87f1d4eae06b
MD5 26c1bfc371e098807c13a9aa5790f63b
BLAKE2b-256 872ccc8cf84ca1f0e7850ebcba433d633202a59acdd0f9a0b240e0bc96b9f6b6

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