Esempio n. 1
0
def _download_data(comet_api: comet_ml.API, experiments: APIExperiments, p1_name: str, p2_name: str, metrics: List[str],
                   parameters: List[str]) \
        -> Dict[str, List[Tuple[float, float, float]]]:
    targets_data = defaultdict(list)
    list2float = lambda l: float(l[0])
    for experiment in experiments:
        p1_value = list2float(comet_api.get_experiment_parameters(experiment.key, p1_name))
        p2_value = list2float(comet_api.get_experiment_parameters(experiment.key, p2_name))
        for parameter in parameters:
            target_data = list2float(comet_api.get_experiment_parameters(experiment.key, parameter))
            targets_data[parameter].append((p1_value, p2_value, target_data))
        for metric in metrics:
            target_data = list2float(comet_api.get_experiment_metrics(experiment.key, metric))
            targets_data[metric].append((p1_value, p2_value, target_data))
    return targets_data
Esempio n. 2
0
import numpy as np
from comet_ml import API
from matplotlib.pyplot import plot, imshow, colorbar, show, axis, hist, subplot, xlabel, ylabel, title, legend, savefig, figure, close, suptitle, tight_layout, xlim, ylim

api = API(rest_api_key='W2gBYYtc8ZbGyyNct5qYGR2Gl')
experiments = api.get('wronnyhuang/ranksweep-1')

ranks = []
errors = []
for experiment in experiments:

    # get the rank
    rank = int(api.get_experiment_parameters(experiment, 'rank')[0])
    ranks.append(rank)

    # get the minimum test error
    metrics = {
        m.pop('name'): m
        for m in api.get_experiment_metrics(experiment)
    }
    error = float(metrics['test_tranfrob']['valueMin'])
    errors.append(error)

plot(ranks, errors, '.', markersize=8)
title('rank vs error')
xlabel('rank')
ylabel('transition error (frob norm)')
show()