Giter Club home page Giter Club logo

pypythia's Introduction

PyPythia Build Status

Python library for the Pythia platform. Supports Python 2.7, 3.5 and 3.6.

Installation

You can fetch the pypythia module via pip::

pip install pypythia

Usage

Simple example:

from pypythia import Experiment

# init experiment

# implies that an instance of Pythia is listening on localhost
exp = Experiment('http://localhost:5667/api/v1/')

exp.name = "some catchy name"
exp.description = "describe the experiment here"

# create a model
model = exp.create_model()
model.name = "2 layers foo bar dropout softmax"

for i in range(NUM_EPOCHS):
    for j in range(NUM_EXAMPLES):
        # the following two lines are not really valid
        train_classifier()
        train_accuracy = accuracy(classifier)

        # save the measured training accuracy
        model.add_measurement(name='train_accuracy',
                              value=train_accuracy,
                              step=j,
                              epoch=i)

Examples

pypythia's People

Contributors

christiansch avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

pypythia's Issues

api version check not verbose enough

when creating a new experiment with a wrong URI you get ominous error messages like AssertionError: or JSONDecodeError: Expecting value: line 1 column 1 (char 0). I should fix that.

Models don't sync their updated attributes with the remote

gbModel = exp.create_model()
gbModel.name = "Gradient Boosting Classifier"

rfModel = exp.create_model()
rfModel.name = "Random Forest Classifier"

Though http://localhost:5667/api/v1/experiment/573451f422dd9841aaec7ee3 yields:

{
   "_id":"573451f422dd9841aaec7ee3",
   "name":"Basic Test Example",
   "description":"Comparing Ensemble Decision Tree Classifiers",
   "__v":6,
   "models":[
      {
         "name":"bow naïve bayes",
         "description":"some description",
         "hyperparameter":"distribution: gaußian, n-grams: 2-grams, stopwords: removed",
         "_id":"573451f422dd9841aaec7ee5",
         "metrics":[

         ],
         "measurements":[

         ],
         "date_added":"2016-05-12T09:50:44.192Z"
      },
      {
         "name":"young-river-3753",
         "_id":"573a17bf0309e87e1163bc8a",
         "measurements":[

         ],
         "date_added":"2016-05-16T18:55:59.844Z"
      },
      {
         "name":"bitter-wood-0904",
         "_id":"573a17e20309e87e1163bc8b",
         "measurements":[

         ],
         "date_added":"2016-05-16T18:56:34.634Z"
      },
      {
         "name":"lucky-breeze-0981",
         "_id":"573a17e20309e87e1163bc8c",
         "measurements":[

         ],
         "date_added":"2016-05-16T18:56:34.728Z"
      },
      {
         "name":"bold-dew-6426",
         "_id":"573a17fc0309e87e1163bc8d",
         "measurements":[

         ],
         "date_added":"2016-05-16T18:57:00.730Z"
      },
      {
         "name":"rough-dream-4113",
         "_id":"573a17fc0309e87e1163bc8e",
         "measurements":[

         ],
         "date_added":"2016-05-16T18:57:00.768Z"
      }
   ],
   "date_added":"2016-05-12T09:50:44.092Z"
}

'Model' object has no attribute '_hyperparameters'

>>> model.description
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pythia/model.py", line 17, in hyperparameters
    return self._hyperparameters
AttributeError: 'Model' object has no attribute '_hyperparameters'

invalid `_id` returns object with invalid state

one can create experiments with invalid ids which in return result in an object being returned which fails later, but not on creation:

>>> exp2 = Experiment('http://localhost:5667/api/v1', '57890cefb6bb2bd287cc4f73 ')
>>> print exp2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pythia/experiment.py", line 42, in __str__
    return self._name
AttributeError: 'Experiment' object has no attribute '_name'

we need to catch these errors on creation, and not afterwards.

hyperparameter attribute not setable

>>> m.hyperparameter = "trees: 100"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: can't set attribute

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.