https://github.com/auggiemarignier/neighpy

Python implementation of the Neighbourhood Algorithm

https://github.com/auggiemarignier/neighpy

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Python implementation of the Neighbourhood Algorithm

Basic Info
  • Host: GitHub
  • Owner: auggiemarignier
  • License: other
  • Language: Python
  • Default Branch: main
  • Size: 9.56 MB
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • Open Issues: 2
  • Releases: 0
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

PyPI version Conda Version test docs

neighpy

neighphy is a Python implementation of the Neighbourhood Algorithm for the optimisation and appraisal of high-dimensional loss surfaces. First presented in two papers by M. Sambridge at the Australian National University in 1999, it has since been widely used, particularly in the geophysical community, for the optimisation of complex, high-dimensional functions.

This implementation hopes to replace the original Fortran code with a more modern, user-friendly and flexible Python package. It is a very simple implementation, with just two classes to implement the two phases of the algorithm: the neighpy.search.NASearcher class for the optimisation phase, and the neighpy.appraise.NAAppraiser class for the appraisal phase

Installation

bash pip install neighpy

Basic Usage

```python import numpy as np from neighpy import NASearcher, NAAppraiser

def objective(x): # Objective function to be minimised return np.linalg.norm(data - predict_data(x))

Bounds of the parameter space

bounds = ((-5, 5), (-5, 5))

Initialise direct search phase

searcher = NASearcher( objective, ns=100, # number of samples per iteration nr=10, # number of cells to resample ni=100, # size of initial random search n=20, # number of iterations bounds=bounds )

Run the direct search phase

searcher.run() # results stored in searcher.samples and searcher.objectives

Initialise the appraisal phase

appraiser = NAAppraiser( searcher.samples, # points of parameter space already sampled np.exp(-searcher.objectives), # objective function values (as a probability distribution) bounds=bounds, nresample=500000, # number of desired new samples nwalkers=10 # number of parallel walkers )

Run the appraisal phase

appraiser.run() # Results stored in appraiser.samples ```

Licence

This code is distributed under a GNU General Public License.

Contributing

If you have any questions, please to open an issue in this repository.

Owner

  • Login: auggiemarignier
  • Kind: user

GitHub Events

Total
  • Issues event: 3
  • Watch event: 2
  • Delete event: 1
  • Issue comment event: 7
  • Push event: 1
  • Pull request event: 2
  • Fork event: 1
  • Create event: 2
Last Year
  • Issues event: 3
  • Watch event: 2
  • Delete event: 1
  • Issue comment event: 7
  • Push event: 1
  • Pull request event: 2
  • Fork event: 1
  • Create event: 2

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 4
  • Total pull requests: 5
  • Average time to close issues: 5 days
  • Average time to close pull requests: 11 minutes
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 1.75
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 2
  • Average time to close issues: 6 days
  • Average time to close pull requests: 2 minutes
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 2.33
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • iandalekelly (2)
  • MatthewJMorris (2)
  • auggiemarignier (2)
Pull Request Authors
  • auggiemarignier (8)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 132 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 11
  • Total maintainers: 1
pypi.org: neighpy

Neighbourhood Algorithm in Python

  • Versions: 11
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 132 Last month
Rankings
Dependent packages count: 9.8%
Average: 37.4%
Dependent repos count: 65.0%
Maintainers (1)
Last synced: 11 months ago

Dependencies

poetry.lock pypi
  • 123 dependencies
pyproject.toml pypi
  • matplotlib ^3.8.2 develop
  • pre-commit ^3.6.0 develop
  • pytest-cov ^4.1.0 develop
  • shapely ^2.0.2 develop
  • types-tqdm ^4.66.0.20240106 develop
  • jupyter ^1.0.0 examples
  • matplotlib ^3.8.2 examples
  • joblib ^1.3.2
  • numpy ^1.26.3
  • python ^3.11
  • scipy ^1.12.0
  • tqdm ^4.66.1
.github/workflows/publish.yaml actions
  • JRubics/poetry-publish v1.16 composite
  • actions/checkout v3 composite
.github/workflows/tests.yaml actions
  • Gr1N/setup-poetry v8 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite