Skip to main content
wandb_workspaces에서 접근할 수 있는 W&B Reports 및 Workspaces API를 사용하면 발견한 내용을 공유하기 위해 웹에 게시할 수 있는 리포트를 생성할 수 있을 뿐만 아니라, 트레이닝과 파인튜닝 작업이 수행된 워크스페이스를 사용자 지정할 수 있습니다.

소스 코드 보기

W&B Reports 및 Workspaces API는 Public Preview 단계입니다.

설치 및 설정

가입 및 API 키 생성

W&B에서 머신을 인증하려면 먼저 User Settings에서 API 키를 생성해야 합니다.

패키지 설치 및 가져오기

W&B Report 및 Workspaces 라이브러리를 설치합니다.
pip install wandb-workspaces

리포트 생성

리포트를 생성하려면 팀의 Entity를 지정하고 리포트 이름을 입력하세요. 꺾쇠 괄호로 둘러싸인 텍스트를 실제 값으로 바꾸세요:
import wandb_workspaces.reports.v2 as wr 
# 생성
report = wr.Report(
    entity="<team_entity>",
    project="<project_name>",
    title='Quickstart Report',
    description="That was easy!"
)

# 리포트 저장
report.save()
다음으로 리포트에 블록과 패널을 추가합니다. 예를 들어, 다음 코드는 목차, 헤더, 그리고 단락이 포함된 리포트를 생성합니다:
report.blocks = [
    wr.TableOfContents(),
    wr.H1("Text and images example"),
    wr.P("Lorem ipsum dolor sit amet."),
]
report.save()
전체 과정을 보여주는 예제를 보려면 Reports API 퀵스타트 Google Colab 노트북을 참고하세요.

워크스페이스 생성

다음 코드는 세 개의 패널(선 플롯, 막대 플롯, 스칼라 차트)을 포함한 섹션이 있는 워크스페이스를 생성하는 예시입니다. 중괄호로 둘러싸인 텍스트를 사용자 값으로 교체하세요:
# 가져오기 방법
import wandb_workspaces.workspaces as ws

# 워크스페이스 생성
ws.Workspace(
     entity="<team_entity>", # 워크스페이스를 소유한 entity
     project="<project_name>", # 워크스페이스와 연결된 프로젝트
     sections=[
         ws.Section(
             name="<Validation Metrics>",
             panels=[
                 wr.LinePlot(x="Step", y=["<val_loss>"]),
                 wr.BarPlot(metrics=["<val_accuracy>"]),
                 wr.ScalarChart(metric="<f1_score>", groupby_aggfunc="<mean>"),
             ],
             is_open=True,
         ),
     ],
)
workspace.save()
전체 과정을 다루는 예제는 Workspace API 퀵스타트 Google Colab 노트북을 참고하세요.