Пример #1
0
 def test_step(self):
     experiment = experiment_factory(
         id="e1",
         checkpoints=[
             checkpoint_factory(id="c1", step=10),
             checkpoint_factory(id="c2"),
             checkpoint_factory(id="c3", step=20),
         ],
     )
     assert experiment.checkpoints.step == [10, None, 20]
Пример #2
0
 def test_slice(self):
     experiment = experiment_factory(
         id="e1",
         checkpoints=[
             checkpoint_factory(id="c1"),
             checkpoint_factory(id="c2"),
             checkpoint_factory(id="c3"),
         ],
     )
     assert isinstance(experiment.checkpoints[:2], CheckpointList)
Пример #3
0
 def test_metrics(self):
     experiment = experiment_factory(
         id="e1",
         checkpoints=[
             checkpoint_factory(id="c1", metrics={"loss": 0.1}),
             checkpoint_factory(id="c2"),
             checkpoint_factory(id="c3", metrics={"foo": "bar"}),
             checkpoint_factory(id="c3", metrics={"loss": 0.2}),
         ],
     )
     assert experiment.checkpoints.metrics["loss"] == [0.1, None, None, 0.2]
Пример #4
0
    def test_repr_html(self, temp_workdir):

        experiment_list = ExperimentList([
            experiment_factory(
                id="e1",
                checkpoints=[
                    checkpoint_factory(
                        id="c1",
                        metrics={"loss": 0.1},
                        primary_metric={
                            "name": "loss",
                            "goal": "minimize"
                        },
                    ),
                    checkpoint_factory(
                        id="c2",
                        metrics={"loss": 0.2},
                        primary_metric={
                            "name": "loss",
                            "goal": "minimize"
                        },
                    ),
                ],
            ),
            experiment_factory(
                id="e2",
                checkpoints=[
                    checkpoint_factory(
                        id="c3",
                        metrics={"loss": 0.2},
                        primary_metric={
                            "name": "loss",
                            "goal": "minimize"
                        },
                    ),
                    checkpoint_factory(
                        id="c4",
                        metrics={"loss": 0.1},
                        primary_metric={
                            "name": "loss",
                            "goal": "minimize"
                        },
                    ),
                ],
            ),
        ])

        assert (experiment_list._repr_html_() == """
<table><tr><th>id</th><th>created</th><th>params</th><th>latest_checkpoint</th><th>best_checkpoint</th></tr>
<tr><th>e1</th><th>2020-01-01 01:01:01</th><th>None</th><th>c2 (loss: 0.2)</th><th>c1 (loss: 0.1)</th></tr>
<tr><th>e2</th><th>2020-01-01 01:01:01</th><th>None</th><th>c4 (loss: 0.1)</th><th>c4 (loss: 0.1)</th></tr></table>"""
                .strip().replace("\n", ""))