Coder Social home page Coder Social logo

jwhhh / cofi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inlab-geo/cofi

1.0 0.0 0.0 50.28 MB

Common Framework for Inference

Home Page: https://cofi.readthedocs.io/en/latest/

License: BSD 2-Clause "Simplified" License

Python 98.37% CMake 1.63%

cofi's Introduction

CoFI (Common Framework for Inference)

PyPI version 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.