Giter Club home page Giter Club logo

digital-experiments's Introduction

A lightweight python package for recording and analysing configurations and results of coding experiments.

PyPI PyPI - Downloads GitHub codecov


Keeping track of the results of coding experiments can be a pain. Over time, code and dependencies can change, and without careful record-keeping, it becomes difficult to remember and reproduce optimal configurations and results.

digital-experiments automates such tracking. To enable this automation, wrap your experiment's main function with the @experiment decorator. Every time the function is called, the following information is saved to disk:

  • the inputs (args, kwargs and defaults)
  • the output/s (any, arbitrary object)
  • the code of the function
  • the current git information (if available)
  • timing information
  • python environment information

This information is available for analysis in the same or different python sessions, via the observations API.

To get started, see the basic use case below, or our example notebook.

Installation

pip install digital-experiments

Basic Use

  1. Define your experiment as a pure-python function, and decorate it with @experiment:
from digital_experiments import experiment

@experiment
def my_experiment(a, b=2):
    return a ** b
  1. Call the function as normal:
>>> my_experiment(2, 3)
8
>>> my_experiment(4)
16
  1. Access the results of the experiment:
>>> my_experiment.observations()
[Observation(<id1>, {'a': 2, 'b': 3} โ†’ 8}),
Observation(<id2>, {'a': 4, 'b': 2} โ†’ 16})]

If you have pandas installed, you can also access these results as a DataFrame:

>>> my_experiment.to_dataframe()
      id  config.a  config.b  result
0  <id1>         2         3       8
1  <id2>         4         2      16

Documentation

For more information, see the documentation.

digital-experiments's People

Contributors

jla-gardner avatar

Stargazers

Congcong Sun avatar Daniel Thomas du Toit avatar Zoรฉ Faure Beaulieu avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

katbaker27

digital-experiments's Issues

Track Trials Gif

  • can you add an option for naming the gif that is saved
  • also an option for choosing to not save the gif

Consistent controller API

It should be easy to "control" experiments automatically.

@experiment
def foo(a, b):
    # do something
    return a + b

control_experiment(
    config_provider=Grid(a=[1, 2, 3], b=[4, 5, 6]),
)

New timing API

Have something like this:

@experiment
def foo():
    with time_step("loading"):
        data = load_data()
    with time_step("training"):
        model = train_on(data)

These could then be stored in the metadata of the experiment run.

Optimisation random points

If I submit multiple jobs and they all start running essentially at the same time, than random points chosen are essentially the same

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.