Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep Visualizations #245

Merged
merged 25 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
37002b1
create heatmap-visualizations for sweeps
lauritofzi May 5, 2023
e552f55
fix viz path + cleanup
lauritofzi May 7, 2023
199c8d5
initial
derpyplops May 14, 2023
1568cd0
refactoring
derpyplops May 14, 2023
181283f
code fix
derpyplops May 14, 2023
2908c0f
fix deps
derpyplops May 14, 2023
6ab281e
fix elk sweep viz flag usage
derpyplops May 15, 2023
ee6e14b
fix typo
derpyplops May 15, 2023
5d526d7
delete comment and factorize
derpyplops May 16, 2023
058cae8
cleanup
lauritowal May 16, 2023
5162cab
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 16, 2023
398ec42
Fix file resolution and factor out sweep_dir()
derpyplops May 16, 2023
9a79c8f
change to relative import
lauritowal May 16, 2023
cf0ad33
Merge branch 'visualizations' of https://github.com/EleutherAI/elk in…
lauritowal May 16, 2023
d6bd7b7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 16, 2023
d4e99b0
Address walt's comments and some tests
derpyplops May 17, 2023
a2e5f60
Change write location to elk-reporters/{sweep}/viz
derpyplops May 18, 2023
68e4b52
Edit README
derpyplops May 18, 2023
0e152bc
Fix TestGetModelPaths
derpyplops May 18, 2023
9d6552f
Fix duplicate bug
derpyplops May 18, 2023
623b2c7
add overwrite flag
derpyplops May 18, 2023
256ad68
add transfer to SweepByDsMultiplot
derpyplops May 18, 2023
9f9c5bb
Remove docstrings for consistency
derpyplops May 18, 2023
033e901
remove vestigial .gitignore
derpyplops May 18, 2023
c176732
remove burns datasets
derpyplops May 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
lauritowal committed May 16, 2023
commit 058cae86f763d558369449a1f3d54634bc86e6d4
22 changes: 12 additions & 10 deletions elk/plotting/command.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
import os
from dataclasses import dataclass, field
from pathlib import Path
from elk.files import elk_reporter_dir

from elk.plotting.visualize import visualize_sweep


@dataclass
class Plot:
sweep: list[str] = field(default_factory=list)
sweeps: list[str] = field(default_factory=list)

def execute(self):
sweeps_path = Path.home() / "elk-reporters" / "sweeps"
# in sweeps_path find the most recent sweep
sweep = max(sweeps_path.iterdir(), key=os.path.getctime)
if self.sweep:
sweep = sweeps_path / self.sweep[0]
sweeps_root_dir = Path.home() / elk_reporter_dir() / "sweeps"

sweep = max(sweeps_root_dir.iterdir(), key=os.path.getctime)
if self.sweeps:
sweep = sweeps_root_dir / self.sweeps[0]
if not sweep.exists():
print(f"No sweep with name {self.sweep[0]} found in {sweeps_path}")
print(f"No sweep with name {self.sweeps[0]} found in {sweeps_root_dir}")
return
if len(self.sweep) > 1:
if len(self.sweeps) > 1:
# TODO support more than one sweep
print(
f"""{len(self.sweep)} paths specified.
f"""{len(self.sweeps)} paths specified.
Only one sweep is supported at this time."""
)
else:
visualize_sweep(sweep) # TODO support more than one sweep
visualize_sweep(sweep)
2 changes: 0 additions & 2 deletions elk/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ def display_table(pivot_table):

table = Table(show_header=True, header_style="bold magenta", show_lines=True)

# Add columns
table.add_column("Run Name")
for column in pivot_table.columns:
table.add_column(str(column))

# Add rows
for index, row in pivot_table.iterrows():
table.add_row(str(index), *[str(value) for value in row])

Expand Down