Contents:
This class represents an experiment with an arbritary number of models.
Creates a new entitiy. If _id is provided, an already existing remote entity is fetched, otherwise a new one is created.
Parameters: |
|
---|
Creates a new model.
Parameters: | _id – if given, attempts to fetch an already existing model. |
---|
This class abstracts the models an experiment has.
Returns new Model instance.
Parameters: |
|
---|
Adds data point of a measurement with respect to a metric to the model.
Parameters: |
|
---|
This class provides the basis for every remote entity. The resource simply specifies its attributes and path, as well as provides setters for the attributes.
It might also provide custom methods as well as a custom initiator. It is mandatory that the inheriting entity calls this class’s init method as well:
ApiBase.__init__(self, api_base, _id=_id)
Checks the API version to guarantee compatibility.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | from pythia 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)
|