forked from evandez/relations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiments.py
32 lines (24 loc) · 848 Bytes
/
experiments.py
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
26
27
28
29
30
31
32
"""Invoke tasks for running experiments."""
from invoke import task
def _maybe_add_device(cmd, device=None):
if device is not None:
cmd = cmd.rstrip() + f" --device {device}"
return cmd
@task
def faithfulness(c, device=None):
"""Run faithfulness experiment."""
cmd = f"python -m scripts.evaluate -b faithfulness -n faithfulness"
cmd = _maybe_add_device(cmd, device=device)
c.run(cmd)
@task
def reconstruction(c, device=None):
"""Run reconstruction experiment."""
cmd = f"python -m scripts.evaluate -b reconstruction -n reconstruction"
cmd = _maybe_add_device(cmd, device=device)
c.run(cmd)
@task
def causality(c, device=None):
"""Run causality experiment."""
cmd = f"python -m scripts.evaluate -b causality -n causality"
cmd = _maybe_add_device(cmd, device=device)
c.run(cmd)