All Projects → IDSIA → Sacred

IDSIA / Sacred

Licence: mit
Sacred is a tool to help you configure, organize, log and reproduce experiments developed at IDSIA.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sacred

researchcompendium
NOTE: This repo is archived. Please see https://github.com/benmarwick/rrtools for my current approach
Stars: ✭ 26 (-99.29%)
Mutual labels:  reproducible-research, reproducible-science, reproducibility
ReproducibleScience
Short course on reproducible science: what, why, how
Stars: ✭ 23 (-99.37%)
Mutual labels:  reproducible-research, reproducible-science, reproducibility
ukbrest
ukbREST: efficient and streamlined data access for reproducible research of large biobanks
Stars: ✭ 32 (-99.13%)
Mutual labels:  reproducible-research, reproducible-science, reproducibility
Awesome Reproducible Research
A curated list of reproducible research case studies, projects, tutorials, and media
Stars: ✭ 106 (-97.12%)
Mutual labels:  reproducible-research, reproducibility, reproducible-science
reprozip-examples
Examples and demos for ReproZip
Stars: ✭ 13 (-99.65%)
Mutual labels:  reproducible-research, reproducible-science, reproducibility
r10e-ds-py
Reproducible Data Science in Python (SciPy 2019 Tutorial)
Stars: ✭ 12 (-99.67%)
Mutual labels:  reproducible-research, reproducible-science, reproducibility
Rrtools
rrtools: Tools for Writing Reproducible Research in R
Stars: ✭ 508 (-86.19%)
Mutual labels:  reproducible-research, reproducibility, reproducible-science
Reprozip
ReproZip is a tool that simplifies the process of creating reproducible experiments from command-line executions, a frequently-used common denominator in computational science.
Stars: ✭ 231 (-93.72%)
Mutual labels:  reproducible-research, reproducibility, reproducible-science
papers-as-modules
Software Papers as Software Modules: Towards a Culture of Reusable Results
Stars: ✭ 18 (-99.51%)
Mutual labels:  reproducible-research, reproducible-science, reproducibility
awflow
Reproducible research and reusable acyclic workflows in Python. Execute code on HPC systems as if you executed them on your personal computer!
Stars: ✭ 15 (-99.59%)
Mutual labels:  reproducible-research, reproducible-science
Reproducibilidad
Reproducible Science: what, why, how
Stars: ✭ 39 (-98.94%)
Mutual labels:  reproducible-science, reproducibility
open-solution-googleai-object-detection
Open solution to the Google AI Object Detection Challenge 🍁
Stars: ✭ 46 (-98.75%)
Mutual labels:  reproducible-research, reproducibility
showyourwork
Fully reproducible, open source scientific articles in LaTeX.
Stars: ✭ 361 (-90.18%)
Mutual labels:  reproducible-research, reproducible-science
alchemy
Experiments logging & visualization
Stars: ✭ 49 (-98.67%)
Mutual labels:  infrastructure, reproducibility
targets-minimal
A minimal example data analysis project with the targets R package
Stars: ✭ 50 (-98.64%)
Mutual labels:  reproducible-research, reproducibility
ngs-preprocess
A pipeline for preprocessing NGS data from Illumina, Nanopore and PacBio technologies
Stars: ✭ 22 (-99.4%)
Mutual labels:  reproducible-research, reproducible-science
openscience
Empirical Software Engineering journal (EMSE) open science and reproducible research initiative
Stars: ✭ 28 (-99.24%)
Mutual labels:  reproducible-research, reproducible-science
single-cell-papers-with-code
Papers with code for single cell related papers
Stars: ✭ 20 (-99.46%)
Mutual labels:  reproducible-research, reproducible-science
emp
🔬 Empirical CLI
Stars: ✭ 42 (-98.86%)
Mutual labels:  reproducible-research, reproducible-science
reproducible
A set of tools for R that enhance reproducibility beyond package management
Stars: ✭ 33 (-99.1%)
Mutual labels:  reproducible-research, reproducibility

Sacred

Every experiment is sacred
Every experiment is great
If an experiment is wasted
God gets quite irate

Current PyPi Version Supported Python Versions MIT licensed ReadTheDocs DOI for this release

Azure CI status Coverage Report Code Scrutinizer Quality Code style: black

Sacred is a tool to help you configure, organize, log and reproduce experiments. It is designed to do all the tedious overhead work that you need to do around your actual experiment in order to:

  • keep track of all the parameters of your experiment
  • easily run your experiment for different settings
  • save configurations for individual runs in a database
  • reproduce your results

Sacred achieves this through the following main mechanisms:

  • Config Scopes A very convenient way of the local variables in a function to define the parameters your experiment uses.
  • Config Injection: You can access all parameters of your configuration from every function. They are automatically injected by name.
  • Command-line interface: You get a powerful command-line interface for each experiment that you can use to change parameters and run different variants.
  • Observers: Sacred provides Observers that log all kinds of information about your experiment, its dependencies, the configuration you used, the machine it is run on, and of course the result. These can be saved to a MongoDB, for easy access later.
  • Automatic seeding helps controlling the randomness in your experiments, such that the results remain reproducible.

Example

Script to train an SVM on the iris dataset The same script as a Sacred experiment
from numpy.random import permutation
from sklearn import svm, datasets





C = 1.0
gamma = 0.7



iris = datasets.load_iris()
perm = permutation(iris.target.size)
iris.data = iris.data[perm]
iris.target = iris.target[perm]
clf = svm.SVC(C, 'rbf', gamma=gamma)
clf.fit(iris.data[:90],
        iris.target[:90])
print(clf.score(iris.data[90:],
                iris.target[90:]))
from numpy.random import permutation
from sklearn import svm, datasets
from sacred import Experiment
ex = Experiment('iris_rbf_svm')

@ex.config
def cfg():
  C = 1.0
  gamma = 0.7

@ex.automain
def run(C, gamma):
  iris = datasets.load_iris()
  per = permutation(iris.target.size)
  iris.data = iris.data[per]
  iris.target = iris.target[per]
  clf = svm.SVC(C, 'rbf', gamma=gamma)
  clf.fit(iris.data[:90],
          iris.target[:90])
  return clf.score(iris.data[90:],
                   iris.target[90:])

Documentation

The documentation is hosted at ReadTheDocs.

Installing

You can directly install it from the Python Package Index with pip:

pip install sacred

Or if you want to do it manually you can checkout the current version from git and install it yourself:

cd sacred
python setup.py install

You might want to also install the numpy and the pymongo packages. They are optional dependencies but they offer some cool features:

pip install numpy, pymongo

Tests

The tests for sacred use the pytest package. You can execute them by running pytest in the sacred directory like this:

pytest

There is also a config file for tox so you can automatically run the tests for various python versions like this:

tox

Update pyptest version

If you update or change the pytest version, the following files need to be changed:

  • dev-requirements.txt
  • tox.ini
  • test/test_utils.py
  • setup.py

Contributing

If you find a bug, have a feature request or want to discuss something general you are welcome to open an issue. If you have a specific question related to the usage of sacred, please ask a question on StackOverflow under the python-sacred tag. We value documentation a lot. If you find something that should be included in the documentation please document it or let us know whats missing. If you are using Sacred in one of your projects and want to share your code with others, put your repo in the Projects using Sacred <docs/projects_using_sacred.rst>_ list. Pull requests are highly welcome!

Frontends

At this point there are three frontends to the database entries created by sacred (that I'm aware of). They are developed externally as separate projects.

Omniboard

docs/images/omniboard-table.png

docs/images/omniboard-metric-graphs.png

Omniboard is a web dashboard that helps in visualizing the experiments and metrics / logs collected by sacred. Omniboard is written with React, Node.js, Express and Bootstrap.

Incense

docs/images/incense-artifact.png

docs/images/incense-metric.png

Incense is a Python library to retrieve runs stored in a MongoDB and interactively display metrics and artifacts in Jupyter notebooks.

Sacredboard

docs/images/sacredboard.png

Sacredboard is a web-based dashboard interface to the sacred runs stored in a MongoDB.

Neptune

docs/images/neptune-compare.png

docs/images/neptune-collaboration.png

Neptune is a web service that lets you visualize, organize and compare your experiment runs. Once things are logged to Neptune you can share it with others, add comments and even access objects via experiment API:

docs/images/neptune-query-api.png

In order to log your runs to Neptune, all you need to do is add an observer:

from neptunecontrib.monitoring.sacred import NeptuneObserver
ex.observers.append(NeptuneObserver(api_token='YOUR_API_TOKEN',
                                    project_name='USER_NAME/PROJECT_NAME'))

For more info, check the neptune-contrib library.

SacredBrowser

docs/images/sacred_browser.png

SacredBrowser is a PyQt4 application to browse the MongoDB entries created by sacred experiments. Features include custom queries, sorting of the results, access to the stored source-code, and many more. No installation is required and it can connect to a local database or over the network.

Prophet

Prophet is an early prototype of a webinterface to the MongoDB entries created by sacred experiments, that is discontinued. It requires you to run RestHeart to access the database.

Related Projects

Sumatra

Sumatra is a tool for managing and tracking projects based on numerical
simulation and/or analysis, with the aim of supporting reproducible research.
It can be thought of as an automated electronic lab notebook for
computational projects.

Sumatra takes a different approach by providing commandline tools to initialize a project and then run arbitrary code (not just python). It tracks information about all runs in a SQL database and even provides a nice browser tool. It integrates less tightly with the code to be run, which makes it easily applicable to non-python experiments. But that also means it requires more setup for each experiment and configuration needs to be done using files. Use this project if you need to run non-python experiments, or are ok with the additional setup/configuration overhead.

Future Gadget Laboratory

FGLab is a machine learning dashboard, designed to make prototyping
experiments easier. Experiment details and results are sent to a database,
which allows analytics to be performed after their completion. The server
is FGLab, and the clients are FGMachines.

Similar to Sumatra, FGLab is an external tool that can keep track of runs from any program. Projects are configured via a JSON schema and the program needs to accept these configurations via command-line options. FGLab also takes the role of a basic scheduler by distributing runs over several machines.

CDE

By tracing system calls during program execution CDE creates a snapshot of all used files and libraries to guarantee the ability to reproduce any unix program execution. It only solves reproducibility, but it does so thoroughly.

License

This project is released under the terms of the MIT license.

Citing Sacred

K. Greff, A. Klein, M. Chovanec, F. Hutter, and J. Schmidhuber, ‘The Sacred Infrastructure for Computational Research’, in Proceedings of the 15th Python in Science Conference (SciPy 2017), Austin, Texas, 2017, pp. 49–56.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].