wandb 0.18.2__py3-none-musllinux_1_2_x86_64.whl
Sign up to get free protection for your applications and to get access to all the features.
- package_readme.md +89 -0
- wandb/__init__.py +245 -0
- wandb/__init__.pyi +1139 -0
- wandb/__main__.py +3 -0
- wandb/_globals.py +19 -0
- wandb/agents/__init__.py +0 -0
- wandb/agents/pyagent.py +363 -0
- wandb/analytics/__init__.py +3 -0
- wandb/analytics/sentry.py +266 -0
- wandb/apis/__init__.py +48 -0
- wandb/apis/attrs.py +40 -0
- wandb/apis/importers/__init__.py +1 -0
- wandb/apis/importers/internals/internal.py +385 -0
- wandb/apis/importers/internals/protocols.py +99 -0
- wandb/apis/importers/internals/util.py +78 -0
- wandb/apis/importers/mlflow.py +254 -0
- wandb/apis/importers/validation.py +108 -0
- wandb/apis/importers/wandb.py +1603 -0
- wandb/apis/internal.py +232 -0
- wandb/apis/normalize.py +89 -0
- wandb/apis/paginator.py +81 -0
- wandb/apis/public/__init__.py +34 -0
- wandb/apis/public/api.py +1305 -0
- wandb/apis/public/artifacts.py +1090 -0
- wandb/apis/public/const.py +4 -0
- wandb/apis/public/files.py +195 -0
- wandb/apis/public/history.py +149 -0
- wandb/apis/public/jobs.py +659 -0
- wandb/apis/public/projects.py +154 -0
- wandb/apis/public/query_generator.py +166 -0
- wandb/apis/public/reports.py +469 -0
- wandb/apis/public/runs.py +914 -0
- wandb/apis/public/sweeps.py +240 -0
- wandb/apis/public/teams.py +198 -0
- wandb/apis/public/users.py +136 -0
- wandb/apis/reports/__init__.py +1 -0
- wandb/apis/reports/v1/__init__.py +8 -0
- wandb/apis/reports/v2/__init__.py +8 -0
- wandb/apis/workspaces/__init__.py +8 -0
- wandb/beta/workflows.py +288 -0
- wandb/bin/nvidia_gpu_stats +0 -0
- wandb/bin/wandb-core +0 -0
- wandb/cli/__init__.py +0 -0
- wandb/cli/cli.py +3004 -0
- wandb/data_types.py +63 -0
- wandb/docker/__init__.py +342 -0
- wandb/docker/auth.py +436 -0
- wandb/docker/wandb-entrypoint.sh +33 -0
- wandb/docker/www_authenticate.py +94 -0
- wandb/env.py +514 -0
- wandb/errors/__init__.py +17 -0
- wandb/errors/errors.py +37 -0
- wandb/errors/term.py +103 -0
- wandb/errors/util.py +57 -0
- wandb/errors/warnings.py +2 -0
- wandb/filesync/__init__.py +0 -0
- wandb/filesync/dir_watcher.py +403 -0
- wandb/filesync/stats.py +100 -0
- wandb/filesync/step_checksum.py +142 -0
- wandb/filesync/step_prepare.py +179 -0
- wandb/filesync/step_upload.py +290 -0
- wandb/filesync/upload_job.py +142 -0
- wandb/integration/__init__.py +0 -0
- wandb/integration/catboost/__init__.py +5 -0
- wandb/integration/catboost/catboost.py +178 -0
- wandb/integration/cohere/__init__.py +3 -0
- wandb/integration/cohere/cohere.py +21 -0
- wandb/integration/cohere/resolver.py +347 -0
- wandb/integration/diffusers/__init__.py +3 -0
- wandb/integration/diffusers/autologger.py +76 -0
- wandb/integration/diffusers/pipeline_resolver.py +50 -0
- wandb/integration/diffusers/resolvers/__init__.py +9 -0
- wandb/integration/diffusers/resolvers/multimodal.py +882 -0
- wandb/integration/diffusers/resolvers/utils.py +102 -0
- wandb/integration/fastai/__init__.py +249 -0
- wandb/integration/gym/__init__.py +105 -0
- wandb/integration/huggingface/__init__.py +3 -0
- wandb/integration/huggingface/huggingface.py +18 -0
- wandb/integration/huggingface/resolver.py +213 -0
- wandb/integration/keras/__init__.py +11 -0
- wandb/integration/keras/callbacks/__init__.py +5 -0
- wandb/integration/keras/callbacks/metrics_logger.py +136 -0
- wandb/integration/keras/callbacks/model_checkpoint.py +195 -0
- wandb/integration/keras/callbacks/tables_builder.py +226 -0
- wandb/integration/keras/keras.py +1091 -0
- wandb/integration/kfp/__init__.py +6 -0
- wandb/integration/kfp/helpers.py +28 -0
- wandb/integration/kfp/kfp_patch.py +324 -0
- wandb/integration/kfp/wandb_logging.py +182 -0
- wandb/integration/langchain/__init__.py +3 -0
- wandb/integration/langchain/wandb_tracer.py +48 -0
- wandb/integration/lightgbm/__init__.py +239 -0
- wandb/integration/lightning/__init__.py +0 -0
- wandb/integration/lightning/fabric/__init__.py +3 -0
- wandb/integration/lightning/fabric/logger.py +762 -0
- wandb/integration/magic.py +556 -0
- wandb/integration/metaflow/__init__.py +3 -0
- wandb/integration/metaflow/metaflow.py +383 -0
- wandb/integration/openai/__init__.py +3 -0
- wandb/integration/openai/fine_tuning.py +480 -0
- wandb/integration/openai/openai.py +22 -0
- wandb/integration/openai/resolver.py +240 -0
- wandb/integration/prodigy/__init__.py +3 -0
- wandb/integration/prodigy/prodigy.py +299 -0
- wandb/integration/sacred/__init__.py +117 -0
- wandb/integration/sagemaker/__init__.py +12 -0
- wandb/integration/sagemaker/auth.py +28 -0
- wandb/integration/sagemaker/config.py +49 -0
- wandb/integration/sagemaker/files.py +3 -0
- wandb/integration/sagemaker/resources.py +34 -0
- wandb/integration/sb3/__init__.py +3 -0
- wandb/integration/sb3/sb3.py +153 -0
- wandb/integration/sklearn/__init__.py +37 -0
- wandb/integration/sklearn/calculate/__init__.py +32 -0
- wandb/integration/sklearn/calculate/calibration_curves.py +125 -0
- wandb/integration/sklearn/calculate/class_proportions.py +68 -0
- wandb/integration/sklearn/calculate/confusion_matrix.py +93 -0
- wandb/integration/sklearn/calculate/decision_boundaries.py +40 -0
- wandb/integration/sklearn/calculate/elbow_curve.py +55 -0
- wandb/integration/sklearn/calculate/feature_importances.py +67 -0
- wandb/integration/sklearn/calculate/learning_curve.py +64 -0
- wandb/integration/sklearn/calculate/outlier_candidates.py +69 -0
- wandb/integration/sklearn/calculate/residuals.py +86 -0
- wandb/integration/sklearn/calculate/silhouette.py +118 -0
- wandb/integration/sklearn/calculate/summary_metrics.py +62 -0
- wandb/integration/sklearn/plot/__init__.py +35 -0
- wandb/integration/sklearn/plot/classifier.py +329 -0
- wandb/integration/sklearn/plot/clusterer.py +146 -0
- wandb/integration/sklearn/plot/regressor.py +121 -0
- wandb/integration/sklearn/plot/shared.py +91 -0
- wandb/integration/sklearn/utils.py +183 -0
- wandb/integration/tensorboard/__init__.py +10 -0
- wandb/integration/tensorboard/log.py +355 -0
- wandb/integration/tensorboard/monkeypatch.py +185 -0
- wandb/integration/tensorflow/__init__.py +5 -0
- wandb/integration/tensorflow/estimator_hook.py +54 -0
- wandb/integration/torch/__init__.py +0 -0
- wandb/integration/torch/wandb_torch.py +554 -0
- wandb/integration/ultralytics/__init__.py +11 -0
- wandb/integration/ultralytics/bbox_utils.py +208 -0
- wandb/integration/ultralytics/callback.py +524 -0
- wandb/integration/ultralytics/classification_utils.py +83 -0
- wandb/integration/ultralytics/mask_utils.py +202 -0
- wandb/integration/ultralytics/pose_utils.py +103 -0
- wandb/integration/xgboost/__init__.py +11 -0
- wandb/integration/xgboost/xgboost.py +189 -0
- wandb/integration/yolov8/__init__.py +0 -0
- wandb/integration/yolov8/yolov8.py +284 -0
- wandb/jupyter.py +515 -0
- wandb/magic.py +3 -0
- wandb/mpmain/__init__.py +0 -0
- wandb/mpmain/__main__.py +1 -0
- wandb/old/__init__.py +0 -0
- wandb/old/core.py +53 -0
- wandb/old/settings.py +173 -0
- wandb/old/summary.py +440 -0
- wandb/plot/__init__.py +19 -0
- wandb/plot/bar.py +45 -0
- wandb/plot/confusion_matrix.py +100 -0
- wandb/plot/histogram.py +39 -0
- wandb/plot/line.py +43 -0
- wandb/plot/line_series.py +88 -0
- wandb/plot/pr_curve.py +136 -0
- wandb/plot/roc_curve.py +118 -0
- wandb/plot/scatter.py +32 -0
- wandb/plot/utils.py +183 -0
- wandb/plot/viz.py +123 -0
- wandb/proto/__init__.py +0 -0
- wandb/proto/v3/__init__.py +0 -0
- wandb/proto/v3/wandb_base_pb2.py +55 -0
- wandb/proto/v3/wandb_internal_pb2.py +1608 -0
- wandb/proto/v3/wandb_server_pb2.py +208 -0
- wandb/proto/v3/wandb_settings_pb2.py +112 -0
- wandb/proto/v3/wandb_telemetry_pb2.py +106 -0
- wandb/proto/v4/__init__.py +0 -0
- wandb/proto/v4/wandb_base_pb2.py +30 -0
- wandb/proto/v4/wandb_internal_pb2.py +360 -0
- wandb/proto/v4/wandb_server_pb2.py +63 -0
- wandb/proto/v4/wandb_settings_pb2.py +45 -0
- wandb/proto/v4/wandb_telemetry_pb2.py +41 -0
- wandb/proto/v5/wandb_base_pb2.py +31 -0
- wandb/proto/v5/wandb_internal_pb2.py +361 -0
- wandb/proto/v5/wandb_server_pb2.py +64 -0
- wandb/proto/v5/wandb_settings_pb2.py +46 -0
- wandb/proto/v5/wandb_telemetry_pb2.py +42 -0
- wandb/proto/wandb_base_pb2.py +10 -0
- wandb/proto/wandb_deprecated.py +53 -0
- wandb/proto/wandb_generate_deprecated.py +34 -0
- wandb/proto/wandb_generate_proto.py +49 -0
- wandb/proto/wandb_internal_pb2.py +16 -0
- wandb/proto/wandb_server_pb2.py +10 -0
- wandb/proto/wandb_settings_pb2.py +10 -0
- wandb/proto/wandb_telemetry_pb2.py +10 -0
- wandb/py.typed +0 -0
- wandb/sdk/__init__.py +37 -0
- wandb/sdk/artifacts/__init__.py +0 -0
- wandb/sdk/artifacts/_validators.py +90 -0
- wandb/sdk/artifacts/artifact.py +2389 -0
- wandb/sdk/artifacts/artifact_download_logger.py +43 -0
- wandb/sdk/artifacts/artifact_file_cache.py +253 -0
- wandb/sdk/artifacts/artifact_instance_cache.py +17 -0
- wandb/sdk/artifacts/artifact_manifest.py +74 -0
- wandb/sdk/artifacts/artifact_manifest_entry.py +249 -0
- wandb/sdk/artifacts/artifact_manifests/__init__.py +0 -0
- wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +92 -0
- wandb/sdk/artifacts/artifact_saver.py +269 -0
- wandb/sdk/artifacts/artifact_state.py +11 -0
- wandb/sdk/artifacts/artifact_ttl.py +7 -0
- wandb/sdk/artifacts/exceptions.py +57 -0
- wandb/sdk/artifacts/staging.py +25 -0
- wandb/sdk/artifacts/storage_handler.py +62 -0
- wandb/sdk/artifacts/storage_handlers/__init__.py +0 -0
- wandb/sdk/artifacts/storage_handlers/azure_handler.py +208 -0
- wandb/sdk/artifacts/storage_handlers/gcs_handler.py +228 -0
- wandb/sdk/artifacts/storage_handlers/http_handler.py +114 -0
- wandb/sdk/artifacts/storage_handlers/local_file_handler.py +141 -0
- wandb/sdk/artifacts/storage_handlers/multi_handler.py +56 -0
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +300 -0
- wandb/sdk/artifacts/storage_handlers/tracking_handler.py +72 -0
- wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +135 -0
- wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +74 -0
- wandb/sdk/artifacts/storage_layout.py +6 -0
- wandb/sdk/artifacts/storage_policies/__init__.py +4 -0
- wandb/sdk/artifacts/storage_policies/register.py +1 -0
- wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +378 -0
- wandb/sdk/artifacts/storage_policy.py +72 -0
- wandb/sdk/backend/__init__.py +0 -0
- wandb/sdk/backend/backend.py +222 -0
- wandb/sdk/data_types/__init__.py +0 -0
- wandb/sdk/data_types/_dtypes.py +914 -0
- wandb/sdk/data_types/_private.py +10 -0
- wandb/sdk/data_types/audio.py +165 -0
- wandb/sdk/data_types/base_types/__init__.py +0 -0
- wandb/sdk/data_types/base_types/json_metadata.py +55 -0
- wandb/sdk/data_types/base_types/media.py +315 -0
- wandb/sdk/data_types/base_types/wb_value.py +272 -0
- wandb/sdk/data_types/bokeh.py +70 -0
- wandb/sdk/data_types/graph.py +405 -0
- wandb/sdk/data_types/helper_types/__init__.py +0 -0
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +295 -0
- wandb/sdk/data_types/helper_types/classes.py +159 -0
- wandb/sdk/data_types/helper_types/image_mask.py +235 -0
- wandb/sdk/data_types/histogram.py +96 -0
- wandb/sdk/data_types/html.py +115 -0
- wandb/sdk/data_types/image.py +845 -0
- wandb/sdk/data_types/molecule.py +241 -0
- wandb/sdk/data_types/object_3d.py +474 -0
- wandb/sdk/data_types/plotly.py +82 -0
- wandb/sdk/data_types/saved_model.py +446 -0
- wandb/sdk/data_types/table.py +1204 -0
- wandb/sdk/data_types/trace_tree.py +438 -0
- wandb/sdk/data_types/utils.py +229 -0
- wandb/sdk/data_types/video.py +247 -0
- wandb/sdk/integration_utils/__init__.py +0 -0
- wandb/sdk/integration_utils/auto_logging.py +239 -0
- wandb/sdk/integration_utils/data_logging.py +475 -0
- wandb/sdk/interface/__init__.py +0 -0
- wandb/sdk/interface/constants.py +4 -0
- wandb/sdk/interface/interface.py +972 -0
- wandb/sdk/interface/interface_queue.py +59 -0
- wandb/sdk/interface/interface_relay.py +53 -0
- wandb/sdk/interface/interface_shared.py +537 -0
- wandb/sdk/interface/interface_sock.py +61 -0
- wandb/sdk/interface/message_future.py +27 -0
- wandb/sdk/interface/message_future_poll.py +50 -0
- wandb/sdk/interface/router.py +118 -0
- wandb/sdk/interface/router_queue.py +44 -0
- wandb/sdk/interface/router_relay.py +39 -0
- wandb/sdk/interface/router_sock.py +36 -0
- wandb/sdk/interface/summary_record.py +67 -0
- wandb/sdk/internal/__init__.py +0 -0
- wandb/sdk/internal/context.py +89 -0
- wandb/sdk/internal/datastore.py +297 -0
- wandb/sdk/internal/file_pusher.py +181 -0
- wandb/sdk/internal/file_stream.py +695 -0
- wandb/sdk/internal/flow_control.py +263 -0
- wandb/sdk/internal/handler.py +901 -0
- wandb/sdk/internal/internal.py +417 -0
- wandb/sdk/internal/internal_api.py +4358 -0
- wandb/sdk/internal/internal_util.py +100 -0
- wandb/sdk/internal/job_builder.py +629 -0
- wandb/sdk/internal/profiler.py +78 -0
- wandb/sdk/internal/progress.py +83 -0
- wandb/sdk/internal/run.py +25 -0
- wandb/sdk/internal/sample.py +70 -0
- wandb/sdk/internal/sender.py +1686 -0
- wandb/sdk/internal/sender_config.py +197 -0
- wandb/sdk/internal/settings_static.py +90 -0
- wandb/sdk/internal/system/__init__.py +0 -0
- wandb/sdk/internal/system/assets/__init__.py +27 -0
- wandb/sdk/internal/system/assets/aggregators.py +37 -0
- wandb/sdk/internal/system/assets/asset_registry.py +20 -0
- wandb/sdk/internal/system/assets/cpu.py +163 -0
- wandb/sdk/internal/system/assets/disk.py +210 -0
- wandb/sdk/internal/system/assets/gpu.py +416 -0
- wandb/sdk/internal/system/assets/gpu_amd.py +239 -0
- wandb/sdk/internal/system/assets/gpu_apple.py +177 -0
- wandb/sdk/internal/system/assets/interfaces.py +207 -0
- wandb/sdk/internal/system/assets/ipu.py +177 -0
- wandb/sdk/internal/system/assets/memory.py +166 -0
- wandb/sdk/internal/system/assets/network.py +125 -0
- wandb/sdk/internal/system/assets/open_metrics.py +299 -0
- wandb/sdk/internal/system/assets/tpu.py +154 -0
- wandb/sdk/internal/system/assets/trainium.py +399 -0
- wandb/sdk/internal/system/env_probe_helpers.py +13 -0
- wandb/sdk/internal/system/system_info.py +249 -0
- wandb/sdk/internal/system/system_monitor.py +229 -0
- wandb/sdk/internal/tb_watcher.py +518 -0
- wandb/sdk/internal/thread_local_settings.py +18 -0
- wandb/sdk/internal/writer.py +206 -0
- wandb/sdk/launch/__init__.py +14 -0
- wandb/sdk/launch/_launch.py +330 -0
- wandb/sdk/launch/_launch_add.py +255 -0
- wandb/sdk/launch/_project_spec.py +566 -0
- wandb/sdk/launch/agent/__init__.py +5 -0
- wandb/sdk/launch/agent/agent.py +924 -0
- wandb/sdk/launch/agent/config.py +296 -0
- wandb/sdk/launch/agent/job_status_tracker.py +53 -0
- wandb/sdk/launch/agent/run_queue_item_file_saver.py +45 -0
- wandb/sdk/launch/builder/__init__.py +0 -0
- wandb/sdk/launch/builder/abstract.py +156 -0
- wandb/sdk/launch/builder/build.py +297 -0
- wandb/sdk/launch/builder/context_manager.py +235 -0
- wandb/sdk/launch/builder/docker_builder.py +177 -0
- wandb/sdk/launch/builder/kaniko_builder.py +595 -0
- wandb/sdk/launch/builder/noop.py +58 -0
- wandb/sdk/launch/builder/templates/_wandb_bootstrap.py +188 -0
- wandb/sdk/launch/builder/templates/dockerfile.py +92 -0
- wandb/sdk/launch/create_job.py +528 -0
- wandb/sdk/launch/environment/abstract.py +29 -0
- wandb/sdk/launch/environment/aws_environment.py +322 -0
- wandb/sdk/launch/environment/azure_environment.py +105 -0
- wandb/sdk/launch/environment/gcp_environment.py +335 -0
- wandb/sdk/launch/environment/local_environment.py +66 -0
- wandb/sdk/launch/errors.py +19 -0
- wandb/sdk/launch/git_reference.py +109 -0
- wandb/sdk/launch/inputs/files.py +148 -0
- wandb/sdk/launch/inputs/internal.py +315 -0
- wandb/sdk/launch/inputs/manage.py +113 -0
- wandb/sdk/launch/inputs/schema.py +39 -0
- wandb/sdk/launch/loader.py +249 -0
- wandb/sdk/launch/registry/abstract.py +48 -0
- wandb/sdk/launch/registry/anon.py +29 -0
- wandb/sdk/launch/registry/azure_container_registry.py +124 -0
- wandb/sdk/launch/registry/elastic_container_registry.py +192 -0
- wandb/sdk/launch/registry/google_artifact_registry.py +219 -0
- wandb/sdk/launch/registry/local_registry.py +67 -0
- wandb/sdk/launch/runner/__init__.py +0 -0
- wandb/sdk/launch/runner/abstract.py +195 -0
- wandb/sdk/launch/runner/kubernetes_monitor.py +474 -0
- wandb/sdk/launch/runner/kubernetes_runner.py +963 -0
- wandb/sdk/launch/runner/local_container.py +301 -0
- wandb/sdk/launch/runner/local_process.py +78 -0
- wandb/sdk/launch/runner/sagemaker_runner.py +426 -0
- wandb/sdk/launch/runner/vertex_runner.py +230 -0
- wandb/sdk/launch/sweeps/__init__.py +39 -0
- wandb/sdk/launch/sweeps/scheduler.py +742 -0
- wandb/sdk/launch/sweeps/scheduler_sweep.py +91 -0
- wandb/sdk/launch/sweeps/utils.py +316 -0
- wandb/sdk/launch/utils.py +746 -0
- wandb/sdk/launch/wandb_reference.py +138 -0
- wandb/sdk/lib/__init__.py +5 -0
- wandb/sdk/lib/_settings_toposort_generate.py +159 -0
- wandb/sdk/lib/_settings_toposort_generated.py +250 -0
- wandb/sdk/lib/_wburls_generate.py +25 -0
- wandb/sdk/lib/_wburls_generated.py +22 -0
- wandb/sdk/lib/apikey.py +273 -0
- wandb/sdk/lib/capped_dict.py +26 -0
- wandb/sdk/lib/config_util.py +101 -0
- wandb/sdk/lib/credentials.py +141 -0
- wandb/sdk/lib/deprecate.py +42 -0
- wandb/sdk/lib/disabled.py +29 -0
- wandb/sdk/lib/exit_hooks.py +54 -0
- wandb/sdk/lib/file_stream_utils.py +118 -0
- wandb/sdk/lib/filenames.py +64 -0
- wandb/sdk/lib/filesystem.py +372 -0
- wandb/sdk/lib/fsm.py +174 -0
- wandb/sdk/lib/gitlib.py +239 -0
- wandb/sdk/lib/gql_request.py +65 -0
- wandb/sdk/lib/handler_util.py +21 -0
- wandb/sdk/lib/hashutil.py +84 -0
- wandb/sdk/lib/import_hooks.py +275 -0
- wandb/sdk/lib/ipython.py +146 -0
- wandb/sdk/lib/json_util.py +80 -0
- wandb/sdk/lib/lazyloader.py +63 -0
- wandb/sdk/lib/mailbox.py +460 -0
- wandb/sdk/lib/module.py +69 -0
- wandb/sdk/lib/paths.py +106 -0
- wandb/sdk/lib/preinit.py +42 -0
- wandb/sdk/lib/printer.py +313 -0
- wandb/sdk/lib/proto_util.py +90 -0
- wandb/sdk/lib/redirect.py +845 -0
- wandb/sdk/lib/reporting.py +99 -0
- wandb/sdk/lib/retry.py +289 -0
- wandb/sdk/lib/run_moment.py +78 -0
- wandb/sdk/lib/runid.py +12 -0
- wandb/sdk/lib/server.py +52 -0
- wandb/sdk/lib/service_connection.py +216 -0
- wandb/sdk/lib/service_token.py +94 -0
- wandb/sdk/lib/sock_client.py +295 -0
- wandb/sdk/lib/sparkline.py +45 -0
- wandb/sdk/lib/telemetry.py +100 -0
- wandb/sdk/lib/timed_input.py +133 -0
- wandb/sdk/lib/timer.py +19 -0
- wandb/sdk/lib/tracelog.py +255 -0
- wandb/sdk/lib/wburls.py +46 -0
- wandb/sdk/service/__init__.py +0 -0
- wandb/sdk/service/_startup_debug.py +22 -0
- wandb/sdk/service/port_file.py +53 -0
- wandb/sdk/service/server.py +116 -0
- wandb/sdk/service/server_sock.py +276 -0
- wandb/sdk/service/service.py +242 -0
- wandb/sdk/service/streams.py +417 -0
- wandb/sdk/verify/__init__.py +0 -0
- wandb/sdk/verify/verify.py +501 -0
- wandb/sdk/wandb_alerts.py +12 -0
- wandb/sdk/wandb_config.py +322 -0
- wandb/sdk/wandb_helper.py +54 -0
- wandb/sdk/wandb_init.py +1266 -0
- wandb/sdk/wandb_login.py +349 -0
- wandb/sdk/wandb_metric.py +110 -0
- wandb/sdk/wandb_require.py +97 -0
- wandb/sdk/wandb_require_helpers.py +44 -0
- wandb/sdk/wandb_run.py +4236 -0
- wandb/sdk/wandb_settings.py +2001 -0
- wandb/sdk/wandb_setup.py +409 -0
- wandb/sdk/wandb_summary.py +150 -0
- wandb/sdk/wandb_sweep.py +119 -0
- wandb/sdk/wandb_sync.py +81 -0
- wandb/sdk/wandb_watch.py +144 -0
- wandb/sklearn.py +35 -0
- wandb/sync/__init__.py +3 -0
- wandb/sync/sync.py +443 -0
- wandb/trigger.py +29 -0
- wandb/util.py +1956 -0
- wandb/vendor/__init__.py +0 -0
- wandb/vendor/gql-0.2.0/setup.py +40 -0
- wandb/vendor/gql-0.2.0/tests/__init__.py +0 -0
- wandb/vendor/gql-0.2.0/tests/starwars/__init__.py +0 -0
- wandb/vendor/gql-0.2.0/tests/starwars/fixtures.py +96 -0
- wandb/vendor/gql-0.2.0/tests/starwars/schema.py +146 -0
- wandb/vendor/gql-0.2.0/tests/starwars/test_dsl.py +293 -0
- wandb/vendor/gql-0.2.0/tests/starwars/test_query.py +355 -0
- wandb/vendor/gql-0.2.0/tests/starwars/test_validation.py +171 -0
- wandb/vendor/gql-0.2.0/tests/test_client.py +31 -0
- wandb/vendor/gql-0.2.0/tests/test_transport.py +89 -0
- wandb/vendor/gql-0.2.0/wandb_gql/__init__.py +4 -0
- wandb/vendor/gql-0.2.0/wandb_gql/client.py +75 -0
- wandb/vendor/gql-0.2.0/wandb_gql/dsl.py +152 -0
- wandb/vendor/gql-0.2.0/wandb_gql/gql.py +10 -0
- wandb/vendor/gql-0.2.0/wandb_gql/transport/__init__.py +0 -0
- wandb/vendor/gql-0.2.0/wandb_gql/transport/http.py +6 -0
- wandb/vendor/gql-0.2.0/wandb_gql/transport/local_schema.py +15 -0
- wandb/vendor/gql-0.2.0/wandb_gql/transport/requests.py +46 -0
- wandb/vendor/gql-0.2.0/wandb_gql/utils.py +21 -0
- wandb/vendor/graphql-core-1.1/setup.py +86 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/__init__.py +287 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/error/__init__.py +6 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/error/base.py +42 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/error/format_error.py +11 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/error/located_error.py +29 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/error/syntax_error.py +36 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/__init__.py +26 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py +311 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py +398 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/__init__.py +0 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py +53 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/gevent.py +22 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/process.py +32 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/sync.py +7 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/thread.py +35 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/utils.py +6 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/__init__.py +0 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py +66 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py +252 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py +151 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/utils.py +7 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py +57 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/execution/values.py +145 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/graphql.py +60 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/__init__.py +0 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/ast.py +1349 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/base.py +19 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/lexer.py +435 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/location.py +30 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/parser.py +779 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/printer.py +193 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/source.py +18 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/visitor.py +222 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/language/visitor_meta.py +82 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/__init__.py +0 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/cached_property.py +17 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/contain_subset.py +28 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/default_ordered_dict.py +40 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/ordereddict.py +8 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py +43 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/version.py +78 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/__init__.py +67 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/definition.py +619 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/directives.py +132 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/introspection.py +440 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/scalars.py +131 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/schema.py +100 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/type/typemap.py +145 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/__init__.py +0 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/assert_valid_name.py +9 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_from_value.py +65 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_to_code.py +49 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_to_dict.py +24 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/base.py +75 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/build_ast_schema.py +291 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/build_client_schema.py +250 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/concat_ast.py +9 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/extend_schema.py +357 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/get_field_def.py +27 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/get_operation_ast.py +21 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/introspection_query.py +90 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/is_valid_literal_value.py +67 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/is_valid_value.py +66 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/quoted_or_list.py +21 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/schema_printer.py +168 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/suggestion_list.py +56 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/type_comparators.py +69 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/type_from_ast.py +21 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/type_info.py +149 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/utils/value_from_ast.py +69 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/__init__.py +4 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/__init__.py +79 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/arguments_of_correct_type.py +24 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/base.py +8 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/default_values_of_correct_type.py +44 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/fields_on_correct_type.py +113 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/fragments_on_composite_types.py +33 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_argument_names.py +70 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_directives.py +97 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_fragment_names.py +19 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_type_names.py +43 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/lone_anonymous_operation.py +23 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_fragment_cycles.py +59 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_undefined_variables.py +36 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_unused_fragments.py +38 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_unused_variables.py +37 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/overlapping_fields_can_be_merged.py +529 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/possible_fragment_spreads.py +44 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/provided_non_null_arguments.py +46 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/scalar_leafs.py +33 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_argument_names.py +32 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_fragment_names.py +28 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_input_field_names.py +33 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_operation_names.py +31 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_variable_names.py +27 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/variables_are_input_types.py +21 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/variables_in_allowed_position.py +53 -0
- wandb/vendor/graphql-core-1.1/wandb_graphql/validation/validation.py +158 -0
- wandb/vendor/promise-2.3.0/conftest.py +30 -0
- wandb/vendor/promise-2.3.0/setup.py +64 -0
- wandb/vendor/promise-2.3.0/tests/__init__.py +0 -0
- wandb/vendor/promise-2.3.0/tests/conftest.py +8 -0
- wandb/vendor/promise-2.3.0/tests/test_awaitable.py +32 -0
- wandb/vendor/promise-2.3.0/tests/test_awaitable_35.py +47 -0
- wandb/vendor/promise-2.3.0/tests/test_benchmark.py +116 -0
- wandb/vendor/promise-2.3.0/tests/test_complex_threads.py +23 -0
- wandb/vendor/promise-2.3.0/tests/test_dataloader.py +452 -0
- wandb/vendor/promise-2.3.0/tests/test_dataloader_awaitable_35.py +99 -0
- wandb/vendor/promise-2.3.0/tests/test_dataloader_extra.py +65 -0
- wandb/vendor/promise-2.3.0/tests/test_extra.py +670 -0
- wandb/vendor/promise-2.3.0/tests/test_issues.py +132 -0
- wandb/vendor/promise-2.3.0/tests/test_promise_list.py +70 -0
- wandb/vendor/promise-2.3.0/tests/test_spec.py +584 -0
- wandb/vendor/promise-2.3.0/tests/test_thread_safety.py +115 -0
- wandb/vendor/promise-2.3.0/tests/utils.py +3 -0
- wandb/vendor/promise-2.3.0/wandb_promise/__init__.py +38 -0
- wandb/vendor/promise-2.3.0/wandb_promise/async_.py +135 -0
- wandb/vendor/promise-2.3.0/wandb_promise/compat.py +32 -0
- wandb/vendor/promise-2.3.0/wandb_promise/dataloader.py +326 -0
- wandb/vendor/promise-2.3.0/wandb_promise/iterate_promise.py +12 -0
- wandb/vendor/promise-2.3.0/wandb_promise/promise.py +848 -0
- wandb/vendor/promise-2.3.0/wandb_promise/promise_list.py +151 -0
- wandb/vendor/promise-2.3.0/wandb_promise/pyutils/__init__.py +0 -0
- wandb/vendor/promise-2.3.0/wandb_promise/pyutils/version.py +83 -0
- wandb/vendor/promise-2.3.0/wandb_promise/schedulers/__init__.py +0 -0
- wandb/vendor/promise-2.3.0/wandb_promise/schedulers/asyncio.py +22 -0
- wandb/vendor/promise-2.3.0/wandb_promise/schedulers/gevent.py +21 -0
- wandb/vendor/promise-2.3.0/wandb_promise/schedulers/immediate.py +27 -0
- wandb/vendor/promise-2.3.0/wandb_promise/schedulers/thread.py +18 -0
- wandb/vendor/promise-2.3.0/wandb_promise/utils.py +56 -0
- wandb/vendor/pygments/__init__.py +90 -0
- wandb/vendor/pygments/cmdline.py +568 -0
- wandb/vendor/pygments/console.py +74 -0
- wandb/vendor/pygments/filter.py +74 -0
- wandb/vendor/pygments/filters/__init__.py +350 -0
- wandb/vendor/pygments/formatter.py +95 -0
- wandb/vendor/pygments/formatters/__init__.py +153 -0
- wandb/vendor/pygments/formatters/_mapping.py +85 -0
- wandb/vendor/pygments/formatters/bbcode.py +109 -0
- wandb/vendor/pygments/formatters/html.py +851 -0
- wandb/vendor/pygments/formatters/img.py +600 -0
- wandb/vendor/pygments/formatters/irc.py +182 -0
- wandb/vendor/pygments/formatters/latex.py +482 -0
- wandb/vendor/pygments/formatters/other.py +160 -0
- wandb/vendor/pygments/formatters/rtf.py +147 -0
- wandb/vendor/pygments/formatters/svg.py +153 -0
- wandb/vendor/pygments/formatters/terminal.py +136 -0
- wandb/vendor/pygments/formatters/terminal256.py +309 -0
- wandb/vendor/pygments/lexer.py +871 -0
- wandb/vendor/pygments/lexers/__init__.py +329 -0
- wandb/vendor/pygments/lexers/_asy_builtins.py +1645 -0
- wandb/vendor/pygments/lexers/_cl_builtins.py +232 -0
- wandb/vendor/pygments/lexers/_cocoa_builtins.py +72 -0
- wandb/vendor/pygments/lexers/_csound_builtins.py +1346 -0
- wandb/vendor/pygments/lexers/_lasso_builtins.py +5327 -0
- wandb/vendor/pygments/lexers/_lua_builtins.py +295 -0
- wandb/vendor/pygments/lexers/_mapping.py +500 -0
- wandb/vendor/pygments/lexers/_mql_builtins.py +1172 -0
- wandb/vendor/pygments/lexers/_openedge_builtins.py +2547 -0
- wandb/vendor/pygments/lexers/_php_builtins.py +4756 -0
- wandb/vendor/pygments/lexers/_postgres_builtins.py +621 -0
- wandb/vendor/pygments/lexers/_scilab_builtins.py +3094 -0
- wandb/vendor/pygments/lexers/_sourcemod_builtins.py +1163 -0
- wandb/vendor/pygments/lexers/_stan_builtins.py +532 -0
- wandb/vendor/pygments/lexers/_stata_builtins.py +419 -0
- wandb/vendor/pygments/lexers/_tsql_builtins.py +1004 -0
- wandb/vendor/pygments/lexers/_vim_builtins.py +1939 -0
- wandb/vendor/pygments/lexers/actionscript.py +240 -0
- wandb/vendor/pygments/lexers/agile.py +24 -0
- wandb/vendor/pygments/lexers/algebra.py +221 -0
- wandb/vendor/pygments/lexers/ambient.py +76 -0
- wandb/vendor/pygments/lexers/ampl.py +87 -0
- wandb/vendor/pygments/lexers/apl.py +101 -0
- wandb/vendor/pygments/lexers/archetype.py +318 -0
- wandb/vendor/pygments/lexers/asm.py +641 -0
- wandb/vendor/pygments/lexers/automation.py +374 -0
- wandb/vendor/pygments/lexers/basic.py +500 -0
- wandb/vendor/pygments/lexers/bibtex.py +160 -0
- wandb/vendor/pygments/lexers/business.py +612 -0
- wandb/vendor/pygments/lexers/c_cpp.py +252 -0
- wandb/vendor/pygments/lexers/c_like.py +541 -0
- wandb/vendor/pygments/lexers/capnproto.py +78 -0
- wandb/vendor/pygments/lexers/chapel.py +102 -0
- wandb/vendor/pygments/lexers/clean.py +288 -0
- wandb/vendor/pygments/lexers/compiled.py +34 -0
- wandb/vendor/pygments/lexers/configs.py +833 -0
- wandb/vendor/pygments/lexers/console.py +114 -0
- wandb/vendor/pygments/lexers/crystal.py +393 -0
- wandb/vendor/pygments/lexers/csound.py +366 -0
- wandb/vendor/pygments/lexers/css.py +689 -0
- wandb/vendor/pygments/lexers/d.py +251 -0
- wandb/vendor/pygments/lexers/dalvik.py +125 -0
- wandb/vendor/pygments/lexers/data.py +555 -0
- wandb/vendor/pygments/lexers/diff.py +165 -0
- wandb/vendor/pygments/lexers/dotnet.py +691 -0
- wandb/vendor/pygments/lexers/dsls.py +878 -0
- wandb/vendor/pygments/lexers/dylan.py +289 -0
- wandb/vendor/pygments/lexers/ecl.py +125 -0
- wandb/vendor/pygments/lexers/eiffel.py +65 -0
- wandb/vendor/pygments/lexers/elm.py +121 -0
- wandb/vendor/pygments/lexers/erlang.py +533 -0
- wandb/vendor/pygments/lexers/esoteric.py +277 -0
- wandb/vendor/pygments/lexers/ezhil.py +69 -0
- wandb/vendor/pygments/lexers/factor.py +344 -0
- wandb/vendor/pygments/lexers/fantom.py +250 -0
- wandb/vendor/pygments/lexers/felix.py +273 -0
- wandb/vendor/pygments/lexers/forth.py +177 -0
- wandb/vendor/pygments/lexers/fortran.py +205 -0
- wandb/vendor/pygments/lexers/foxpro.py +428 -0
- wandb/vendor/pygments/lexers/functional.py +21 -0
- wandb/vendor/pygments/lexers/go.py +101 -0
- wandb/vendor/pygments/lexers/grammar_notation.py +213 -0
- wandb/vendor/pygments/lexers/graph.py +80 -0
- wandb/vendor/pygments/lexers/graphics.py +553 -0
- wandb/vendor/pygments/lexers/haskell.py +843 -0
- wandb/vendor/pygments/lexers/haxe.py +936 -0
- wandb/vendor/pygments/lexers/hdl.py +382 -0
- wandb/vendor/pygments/lexers/hexdump.py +103 -0
- wandb/vendor/pygments/lexers/html.py +602 -0
- wandb/vendor/pygments/lexers/idl.py +270 -0
- wandb/vendor/pygments/lexers/igor.py +288 -0
- wandb/vendor/pygments/lexers/inferno.py +96 -0
- wandb/vendor/pygments/lexers/installers.py +322 -0
- wandb/vendor/pygments/lexers/int_fiction.py +1343 -0
- wandb/vendor/pygments/lexers/iolang.py +63 -0
- wandb/vendor/pygments/lexers/j.py +146 -0
- wandb/vendor/pygments/lexers/javascript.py +1525 -0
- wandb/vendor/pygments/lexers/julia.py +333 -0
- wandb/vendor/pygments/lexers/jvm.py +1573 -0
- wandb/vendor/pygments/lexers/lisp.py +2621 -0
- wandb/vendor/pygments/lexers/make.py +202 -0
- wandb/vendor/pygments/lexers/markup.py +595 -0
- wandb/vendor/pygments/lexers/math.py +21 -0
- wandb/vendor/pygments/lexers/matlab.py +663 -0
- wandb/vendor/pygments/lexers/ml.py +769 -0
- wandb/vendor/pygments/lexers/modeling.py +358 -0
- wandb/vendor/pygments/lexers/modula2.py +1561 -0
- wandb/vendor/pygments/lexers/monte.py +204 -0
- wandb/vendor/pygments/lexers/ncl.py +894 -0
- wandb/vendor/pygments/lexers/nimrod.py +159 -0
- wandb/vendor/pygments/lexers/nit.py +64 -0
- wandb/vendor/pygments/lexers/nix.py +136 -0
- wandb/vendor/pygments/lexers/oberon.py +105 -0
- wandb/vendor/pygments/lexers/objective.py +504 -0
- wandb/vendor/pygments/lexers/ooc.py +85 -0
- wandb/vendor/pygments/lexers/other.py +41 -0
- wandb/vendor/pygments/lexers/parasail.py +79 -0
- wandb/vendor/pygments/lexers/parsers.py +835 -0
- wandb/vendor/pygments/lexers/pascal.py +644 -0
- wandb/vendor/pygments/lexers/pawn.py +199 -0
- wandb/vendor/pygments/lexers/perl.py +620 -0
- wandb/vendor/pygments/lexers/php.py +267 -0
- wandb/vendor/pygments/lexers/praat.py +294 -0
- wandb/vendor/pygments/lexers/prolog.py +306 -0
- wandb/vendor/pygments/lexers/python.py +939 -0
- wandb/vendor/pygments/lexers/qvt.py +152 -0
- wandb/vendor/pygments/lexers/r.py +453 -0
- wandb/vendor/pygments/lexers/rdf.py +270 -0
- wandb/vendor/pygments/lexers/rebol.py +431 -0
- wandb/vendor/pygments/lexers/resource.py +85 -0
- wandb/vendor/pygments/lexers/rnc.py +67 -0
- wandb/vendor/pygments/lexers/roboconf.py +82 -0
- wandb/vendor/pygments/lexers/robotframework.py +560 -0
- wandb/vendor/pygments/lexers/ruby.py +519 -0
- wandb/vendor/pygments/lexers/rust.py +220 -0
- wandb/vendor/pygments/lexers/sas.py +228 -0
- wandb/vendor/pygments/lexers/scripting.py +1222 -0
- wandb/vendor/pygments/lexers/shell.py +794 -0
- wandb/vendor/pygments/lexers/smalltalk.py +195 -0
- wandb/vendor/pygments/lexers/smv.py +79 -0
- wandb/vendor/pygments/lexers/snobol.py +83 -0
- wandb/vendor/pygments/lexers/special.py +103 -0
- wandb/vendor/pygments/lexers/sql.py +681 -0
- wandb/vendor/pygments/lexers/stata.py +108 -0
- wandb/vendor/pygments/lexers/supercollider.py +90 -0
- wandb/vendor/pygments/lexers/tcl.py +145 -0
- wandb/vendor/pygments/lexers/templates.py +2283 -0
- wandb/vendor/pygments/lexers/testing.py +207 -0
- wandb/vendor/pygments/lexers/text.py +25 -0
- wandb/vendor/pygments/lexers/textedit.py +169 -0
- wandb/vendor/pygments/lexers/textfmts.py +297 -0
- wandb/vendor/pygments/lexers/theorem.py +458 -0
- wandb/vendor/pygments/lexers/trafficscript.py +54 -0
- wandb/vendor/pygments/lexers/typoscript.py +226 -0
- wandb/vendor/pygments/lexers/urbi.py +133 -0
- wandb/vendor/pygments/lexers/varnish.py +190 -0
- wandb/vendor/pygments/lexers/verification.py +111 -0
- wandb/vendor/pygments/lexers/web.py +24 -0
- wandb/vendor/pygments/lexers/webmisc.py +988 -0
- wandb/vendor/pygments/lexers/whiley.py +116 -0
- wandb/vendor/pygments/lexers/x10.py +69 -0
- wandb/vendor/pygments/modeline.py +44 -0
- wandb/vendor/pygments/plugin.py +68 -0
- wandb/vendor/pygments/regexopt.py +92 -0
- wandb/vendor/pygments/scanner.py +105 -0
- wandb/vendor/pygments/sphinxext.py +158 -0
- wandb/vendor/pygments/style.py +155 -0
- wandb/vendor/pygments/styles/__init__.py +80 -0
- wandb/vendor/pygments/styles/abap.py +29 -0
- wandb/vendor/pygments/styles/algol.py +63 -0
- wandb/vendor/pygments/styles/algol_nu.py +63 -0
- wandb/vendor/pygments/styles/arduino.py +98 -0
- wandb/vendor/pygments/styles/autumn.py +65 -0
- wandb/vendor/pygments/styles/borland.py +51 -0
- wandb/vendor/pygments/styles/bw.py +49 -0
- wandb/vendor/pygments/styles/colorful.py +81 -0
- wandb/vendor/pygments/styles/default.py +73 -0
- wandb/vendor/pygments/styles/emacs.py +72 -0
- wandb/vendor/pygments/styles/friendly.py +72 -0
- wandb/vendor/pygments/styles/fruity.py +42 -0
- wandb/vendor/pygments/styles/igor.py +29 -0
- wandb/vendor/pygments/styles/lovelace.py +97 -0
- wandb/vendor/pygments/styles/manni.py +75 -0
- wandb/vendor/pygments/styles/monokai.py +106 -0
- wandb/vendor/pygments/styles/murphy.py +80 -0
- wandb/vendor/pygments/styles/native.py +65 -0
- wandb/vendor/pygments/styles/paraiso_dark.py +125 -0
- wandb/vendor/pygments/styles/paraiso_light.py +125 -0
- wandb/vendor/pygments/styles/pastie.py +75 -0
- wandb/vendor/pygments/styles/perldoc.py +69 -0
- wandb/vendor/pygments/styles/rainbow_dash.py +89 -0
- wandb/vendor/pygments/styles/rrt.py +33 -0
- wandb/vendor/pygments/styles/sas.py +44 -0
- wandb/vendor/pygments/styles/stata.py +40 -0
- wandb/vendor/pygments/styles/tango.py +141 -0
- wandb/vendor/pygments/styles/trac.py +63 -0
- wandb/vendor/pygments/styles/vim.py +63 -0
- wandb/vendor/pygments/styles/vs.py +38 -0
- wandb/vendor/pygments/styles/xcode.py +51 -0
- wandb/vendor/pygments/token.py +213 -0
- wandb/vendor/pygments/unistring.py +217 -0
- wandb/vendor/pygments/util.py +388 -0
- wandb/vendor/pynvml/__init__.py +0 -0
- wandb/vendor/pynvml/pynvml.py +4779 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/__init__.py +17 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py +615 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/__init__.py +98 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/api.py +369 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents.py +172 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py +239 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify.py +218 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_buffer.py +81 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py +575 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py +730 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py +145 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/read_directory_changes.py +133 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/winapi.py +348 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/patterns.py +265 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/tricks/__init__.py +174 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py +151 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py +249 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/compat.py +29 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/decorators.py +198 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py +88 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py +293 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py +157 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/event_backport.py +41 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/importlib2.py +40 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py +57 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/unicode_paths.py +64 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/win32stat.py +123 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/version.py +28 -0
- wandb/vendor/watchdog_0_9_0/wandb_watchdog/watchmedo.py +577 -0
- wandb/wandb_agent.py +588 -0
- wandb/wandb_controller.py +721 -0
- wandb/wandb_run.py +9 -0
- wandb-0.18.2.dist-info/METADATA +213 -0
- wandb-0.18.2.dist-info/RECORD +827 -0
- wandb-0.18.2.dist-info/WHEEL +5 -0
- wandb-0.18.2.dist-info/entry_points.txt +3 -0
- wandb-0.18.2.dist-info/licenses/LICENSE +21 -0
wandb/__init__.pyi
ADDED
@@ -0,0 +1,1139 @@
|
|
1
|
+
"""Use wandb to track machine learning work.
|
2
|
+
|
3
|
+
Train and fine-tune models, manage models from experimentation to production.
|
4
|
+
|
5
|
+
For guides and examples, see https://docs.wandb.ai.
|
6
|
+
|
7
|
+
For scripts and interactive notebooks, see https://github.com/wandb/examples.
|
8
|
+
|
9
|
+
For reference documentation, see https://docs.wandb.com/ref/python.
|
10
|
+
"""
|
11
|
+
|
12
|
+
from __future__ import annotations
|
13
|
+
|
14
|
+
__all__ = (
|
15
|
+
"__version__",
|
16
|
+
"init",
|
17
|
+
"finish",
|
18
|
+
"setup",
|
19
|
+
"login",
|
20
|
+
"save",
|
21
|
+
"sweep",
|
22
|
+
"controller",
|
23
|
+
"agent",
|
24
|
+
"config",
|
25
|
+
"log",
|
26
|
+
"summary",
|
27
|
+
"Api",
|
28
|
+
"Graph",
|
29
|
+
"Image",
|
30
|
+
"Plotly",
|
31
|
+
"Video",
|
32
|
+
"Audio",
|
33
|
+
"Table",
|
34
|
+
"Html",
|
35
|
+
"box3d",
|
36
|
+
"Object3D",
|
37
|
+
"Molecule",
|
38
|
+
"Histogram",
|
39
|
+
"ArtifactTTL",
|
40
|
+
"log_artifact",
|
41
|
+
"use_artifact",
|
42
|
+
"log_model",
|
43
|
+
"use_model",
|
44
|
+
"link_model",
|
45
|
+
"define_metric",
|
46
|
+
"Error",
|
47
|
+
"termsetup",
|
48
|
+
"termlog",
|
49
|
+
"termerror",
|
50
|
+
"termwarn",
|
51
|
+
"Artifact",
|
52
|
+
"Settings",
|
53
|
+
"teardown",
|
54
|
+
"watch",
|
55
|
+
)
|
56
|
+
|
57
|
+
import os
|
58
|
+
from typing import (
|
59
|
+
TYPE_CHECKING,
|
60
|
+
Any,
|
61
|
+
Callable,
|
62
|
+
Dict,
|
63
|
+
List,
|
64
|
+
Literal,
|
65
|
+
Optional,
|
66
|
+
Sequence,
|
67
|
+
Union,
|
68
|
+
)
|
69
|
+
|
70
|
+
from wandb.analytics import Sentry
|
71
|
+
from wandb.apis import InternalApi, PublicApi
|
72
|
+
from wandb.data_types import (
|
73
|
+
Audio,
|
74
|
+
Graph,
|
75
|
+
Histogram,
|
76
|
+
Html,
|
77
|
+
Image,
|
78
|
+
Molecule,
|
79
|
+
Object3D,
|
80
|
+
Plotly,
|
81
|
+
Table,
|
82
|
+
Video,
|
83
|
+
box3d,
|
84
|
+
)
|
85
|
+
from wandb.errors import Error
|
86
|
+
from wandb.errors.term import termerror, termlog, termsetup, termwarn
|
87
|
+
from wandb.sdk import Artifact, Settings, wandb_config, wandb_metric, wandb_summary
|
88
|
+
from wandb.sdk.artifacts.artifact_ttl import ArtifactTTL
|
89
|
+
from wandb.sdk.interface.interface import PolicyName
|
90
|
+
from wandb.sdk.lib.paths import FilePathStr, StrPath
|
91
|
+
from wandb.sdk.wandb_run import Run
|
92
|
+
from wandb.sdk.wandb_setup import _WandbSetup
|
93
|
+
from wandb.wandb_controller import _WandbController
|
94
|
+
|
95
|
+
if TYPE_CHECKING:
|
96
|
+
import torch # type: ignore [import-not-found]
|
97
|
+
|
98
|
+
__version__: str = "0.18.2"
|
99
|
+
|
100
|
+
run: Run | None
|
101
|
+
config: wandb_config.Config
|
102
|
+
summary: wandb_summary.Summary
|
103
|
+
Api: PublicApi
|
104
|
+
|
105
|
+
# private attributes
|
106
|
+
_sentry: Sentry
|
107
|
+
api: InternalApi
|
108
|
+
patched: Dict[str, List[Callable]]
|
109
|
+
|
110
|
+
def setup(
|
111
|
+
settings: Optional[Settings] = None,
|
112
|
+
) -> Optional[_WandbSetup]:
|
113
|
+
"""Prepares W&B for use in the current process and its children.
|
114
|
+
|
115
|
+
You can usually ignore this as it is implicitly called by `wandb.init()`.
|
116
|
+
|
117
|
+
When using wandb in multiple processes, calling `wandb.setup()`
|
118
|
+
in the parent process before starting child processes may improve
|
119
|
+
performance and resource utilization.
|
120
|
+
|
121
|
+
Note that `wandb.setup()` modifies `os.environ`, and it is important
|
122
|
+
that child processes inherit the modified environment variables.
|
123
|
+
|
124
|
+
See also `wandb.teardown()`.
|
125
|
+
|
126
|
+
Args:
|
127
|
+
settings (Optional[Union[Dict[str, Any], wandb.Settings]]): Configuration settings
|
128
|
+
to apply globally. These can be overridden by subsequent `wandb.init()` calls.
|
129
|
+
|
130
|
+
Example:
|
131
|
+
```python
|
132
|
+
import multiprocessing
|
133
|
+
|
134
|
+
import wandb
|
135
|
+
|
136
|
+
|
137
|
+
def run_experiment(params):
|
138
|
+
with wandb.init(config=params):
|
139
|
+
# Run experiment
|
140
|
+
pass
|
141
|
+
|
142
|
+
|
143
|
+
if __name__ == "__main__":
|
144
|
+
# Start backend and set global config
|
145
|
+
wandb.setup(settings={"project": "my_project"})
|
146
|
+
|
147
|
+
# Define experiment parameters
|
148
|
+
experiment_params = [
|
149
|
+
{"learning_rate": 0.01, "epochs": 10},
|
150
|
+
{"learning_rate": 0.001, "epochs": 20},
|
151
|
+
]
|
152
|
+
|
153
|
+
# Start multiple processes, each running a separate experiment
|
154
|
+
processes = []
|
155
|
+
for params in experiment_params:
|
156
|
+
p = multiprocessing.Process(target=run_experiment, args=(params,))
|
157
|
+
p.start()
|
158
|
+
processes.append(p)
|
159
|
+
|
160
|
+
# Wait for all processes to complete
|
161
|
+
for p in processes:
|
162
|
+
p.join()
|
163
|
+
|
164
|
+
# Optional: Explicitly shut down the backend
|
165
|
+
wandb.teardown()
|
166
|
+
```
|
167
|
+
"""
|
168
|
+
...
|
169
|
+
|
170
|
+
def teardown(exit_code: Optional[int] = None) -> None:
|
171
|
+
"""Waits for wandb to finish and frees resources.
|
172
|
+
|
173
|
+
Completes any runs that were not explicitly finished
|
174
|
+
using `run.finish()` and waits for all data to be uploaded.
|
175
|
+
|
176
|
+
It is recommended to call this at the end of a session
|
177
|
+
that used `wandb.setup()`. It is invoked automatically
|
178
|
+
in an `atexit` hook, but this is not reliable in certain setups
|
179
|
+
such as when using Python's `multiprocessing` module.
|
180
|
+
"""
|
181
|
+
...
|
182
|
+
|
183
|
+
def init(
|
184
|
+
job_type: Optional[str] = None,
|
185
|
+
dir: Optional[StrPath] = None,
|
186
|
+
config: Union[Dict, str, None] = None,
|
187
|
+
project: Optional[str] = None,
|
188
|
+
entity: Optional[str] = None,
|
189
|
+
reinit: Optional[bool] = None,
|
190
|
+
tags: Optional[Sequence] = None,
|
191
|
+
group: Optional[str] = None,
|
192
|
+
name: Optional[str] = None,
|
193
|
+
notes: Optional[str] = None,
|
194
|
+
magic: Optional[Union[dict, str, bool]] = None,
|
195
|
+
config_exclude_keys: Optional[List[str]] = None,
|
196
|
+
config_include_keys: Optional[List[str]] = None,
|
197
|
+
anonymous: Optional[str] = None,
|
198
|
+
mode: Optional[str] = None,
|
199
|
+
allow_val_change: Optional[bool] = None,
|
200
|
+
resume: Optional[Union[bool, str]] = None,
|
201
|
+
force: Optional[bool] = None,
|
202
|
+
tensorboard: Optional[bool] = None,
|
203
|
+
sync_tensorboard: Optional[bool] = None,
|
204
|
+
monitor_gym: Optional[bool] = None,
|
205
|
+
save_code: Optional[bool] = None,
|
206
|
+
id: Optional[str] = None,
|
207
|
+
fork_from: Optional[str] = None,
|
208
|
+
resume_from: Optional[str] = None,
|
209
|
+
settings: Union[Settings, Dict[str, Any], None] = None,
|
210
|
+
) -> Run:
|
211
|
+
r"""Start a new run to track and log to W&B.
|
212
|
+
|
213
|
+
In an ML training pipeline, you could add `wandb.init()`
|
214
|
+
to the beginning of your training script as well as your evaluation
|
215
|
+
script, and each piece would be tracked as a run in W&B.
|
216
|
+
|
217
|
+
`wandb.init()` spawns a new background process to log data to a run, and it
|
218
|
+
also syncs data to wandb.ai by default, so you can see live visualizations.
|
219
|
+
|
220
|
+
Call `wandb.init()` to start a run before logging data with `wandb.log()`:
|
221
|
+
<!--yeadoc-test:init-method-log-->
|
222
|
+
```python
|
223
|
+
import wandb
|
224
|
+
|
225
|
+
wandb.init()
|
226
|
+
# ... calculate metrics, generate media
|
227
|
+
wandb.log({"accuracy": 0.9})
|
228
|
+
```
|
229
|
+
|
230
|
+
`wandb.init()` returns a run object, and you can also access the run object
|
231
|
+
via `wandb.run`:
|
232
|
+
<!--yeadoc-test:init-and-assert-global-->
|
233
|
+
```python
|
234
|
+
import wandb
|
235
|
+
|
236
|
+
run = wandb.init()
|
237
|
+
|
238
|
+
assert run is wandb.run
|
239
|
+
```
|
240
|
+
|
241
|
+
At the end of your script, we will automatically call `wandb.finish` to
|
242
|
+
finalize and cleanup the run. However, if you call `wandb.init` from a
|
243
|
+
child process, you must explicitly call `wandb.finish` at the end of the
|
244
|
+
child process.
|
245
|
+
|
246
|
+
For more on using `wandb.init()`, including detailed examples, check out our
|
247
|
+
[guide and FAQs](https://docs.wandb.ai/guides/track/launch).
|
248
|
+
|
249
|
+
Arguments:
|
250
|
+
project: (str, optional) The name of the project where you're sending
|
251
|
+
the new run. If the project is not specified, we will try to infer
|
252
|
+
the project name from git root or the current program file. If we
|
253
|
+
can't infer the project name, we will default to `"uncategorized"`.
|
254
|
+
entity: (str, optional) An entity is a username or team name where
|
255
|
+
you're sending runs. This entity must exist before you can send runs
|
256
|
+
there, so make sure to create your account or team in the UI before
|
257
|
+
starting to log runs.
|
258
|
+
If you don't specify an entity, the run will be sent to your default
|
259
|
+
entity. Change your default entity
|
260
|
+
in [your settings](https://wandb.ai/settings) under "default location
|
261
|
+
to create new projects".
|
262
|
+
config: (dict, argparse, absl.flags, str, optional)
|
263
|
+
This sets `wandb.config`, a dictionary-like object for saving inputs
|
264
|
+
to your job, like hyperparameters for a model or settings for a data
|
265
|
+
preprocessing job. The config will show up in a table in the UI that
|
266
|
+
you can use to group, filter, and sort runs. Keys should not contain
|
267
|
+
`.` in their names, and values should be under 10 MB.
|
268
|
+
If dict, argparse or absl.flags: will load the key value pairs into
|
269
|
+
the `wandb.config` object.
|
270
|
+
If str: will look for a yaml file by that name, and load config from
|
271
|
+
that file into the `wandb.config` object.
|
272
|
+
save_code: (bool, optional) Turn this on to save the main script or
|
273
|
+
notebook to W&B. This is valuable for improving experiment
|
274
|
+
reproducibility and to diff code across experiments in the UI. By
|
275
|
+
default this is off, but you can flip the default behavior to on
|
276
|
+
in [your settings page](https://wandb.ai/settings).
|
277
|
+
group: (str, optional) Specify a group to organize individual runs into
|
278
|
+
a larger experiment. For example, you might be doing cross
|
279
|
+
validation, or you might have multiple jobs that train and evaluate
|
280
|
+
a model against different test sets. Group gives you a way to
|
281
|
+
organize runs together into a larger whole, and you can toggle this
|
282
|
+
on and off in the UI. For more details, see our
|
283
|
+
[guide to grouping runs](https://docs.wandb.com/guides/runs/grouping).
|
284
|
+
job_type: (str, optional) Specify the type of run, which is useful when
|
285
|
+
you're grouping runs together into larger experiments using group.
|
286
|
+
For example, you might have multiple jobs in a group, with job types
|
287
|
+
like train and eval. Setting this makes it easy to filter and group
|
288
|
+
similar runs together in the UI so you can compare apples to apples.
|
289
|
+
tags: (list, optional) A list of strings, which will populate the list
|
290
|
+
of tags on this run in the UI. Tags are useful for organizing runs
|
291
|
+
together, or applying temporary labels like "baseline" or
|
292
|
+
"production". It's easy to add and remove tags in the UI, or filter
|
293
|
+
down to just runs with a specific tag.
|
294
|
+
If you are resuming a run, its tags will be overwritten by the tags
|
295
|
+
you pass to `wandb.init()`. If you want to add tags to a resumed run
|
296
|
+
without overwriting its existing tags, use `run.tags += ["new_tag"]`
|
297
|
+
after `wandb.init()`.
|
298
|
+
name: (str, optional) A short display name for this run, which is how
|
299
|
+
you'll identify this run in the UI. By default, we generate a random
|
300
|
+
two-word name that lets you easily cross-reference runs from the
|
301
|
+
table to charts. Keeping these run names short makes the chart
|
302
|
+
legends and tables easier to read. If you're looking for a place to
|
303
|
+
save your hyperparameters, we recommend saving those in config.
|
304
|
+
notes: (str, optional) A longer description of the run, like a `-m` commit
|
305
|
+
message in git. This helps you remember what you were doing when you
|
306
|
+
ran this run.
|
307
|
+
dir: (str or pathlib.Path, optional) An absolute path to a directory where
|
308
|
+
metadata will be stored. When you call `download()` on an artifact,
|
309
|
+
this is the directory where downloaded files will be saved. By default,
|
310
|
+
this is the `./wandb` directory.
|
311
|
+
resume: (bool, str, optional) Sets the resuming behavior. Options:
|
312
|
+
`"allow"`, `"must"`, `"never"`, `"auto"` or `None`. Defaults to `None`.
|
313
|
+
Cases:
|
314
|
+
- `None` (default): If the new run has the same ID as a previous run,
|
315
|
+
this run overwrites that data.
|
316
|
+
- `"auto"` (or `True`): if the previous run on this machine crashed,
|
317
|
+
automatically resume it. Otherwise, start a new run.
|
318
|
+
- `"allow"`: if id is set with `init(id="UNIQUE_ID")` or
|
319
|
+
`WANDB_RUN_ID="UNIQUE_ID"` and it is identical to a previous run,
|
320
|
+
wandb will automatically resume the run with that id. Otherwise,
|
321
|
+
wandb will start a new run.
|
322
|
+
- `"never"`: if id is set with `init(id="UNIQUE_ID")` or
|
323
|
+
`WANDB_RUN_ID="UNIQUE_ID"` and it is identical to a previous run,
|
324
|
+
wandb will crash.
|
325
|
+
- `"must"`: if id is set with `init(id="UNIQUE_ID")` or
|
326
|
+
`WANDB_RUN_ID="UNIQUE_ID"` and it is identical to a previous run,
|
327
|
+
wandb will automatically resume the run with the id. Otherwise,
|
328
|
+
wandb will crash.
|
329
|
+
See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming)
|
330
|
+
for more.
|
331
|
+
reinit: (bool, optional) Allow multiple `wandb.init()` calls in the same
|
332
|
+
process. (default: `False`)
|
333
|
+
magic: (bool, dict, or str, optional) The bool controls whether we try to
|
334
|
+
auto-instrument your script, capturing basic details of your run
|
335
|
+
without you having to add more wandb code. (default: `False`)
|
336
|
+
You can also pass a dict, json string, or yaml filename.
|
337
|
+
config_exclude_keys: (list, optional) string keys to exclude from
|
338
|
+
`wandb.config`.
|
339
|
+
config_include_keys: (list, optional) string keys to include in
|
340
|
+
`wandb.config`.
|
341
|
+
anonymous: (str, optional) Controls anonymous data logging. Options:
|
342
|
+
- `"never"` (default): requires you to link your W&B account before
|
343
|
+
tracking the run, so you don't accidentally create an anonymous
|
344
|
+
run.
|
345
|
+
- `"allow"`: lets a logged-in user track runs with their account, but
|
346
|
+
lets someone who is running the script without a W&B account see
|
347
|
+
the charts in the UI.
|
348
|
+
- `"must"`: sends the run to an anonymous account instead of to a
|
349
|
+
signed-up user account.
|
350
|
+
mode: (str, optional) Can be `"online"`, `"offline"` or `"disabled"`. Defaults to
|
351
|
+
online.
|
352
|
+
allow_val_change: (bool, optional) Whether to allow config values to
|
353
|
+
change after setting the keys once. By default, we throw an exception
|
354
|
+
if a config value is overwritten. If you want to track something
|
355
|
+
like a varying learning rate at multiple times during training, use
|
356
|
+
`wandb.log()` instead. (default: `False` in scripts, `True` in Jupyter)
|
357
|
+
force: (bool, optional) If `True`, this crashes the script if a user isn't
|
358
|
+
logged in to W&B. If `False`, this will let the script run in offline
|
359
|
+
mode if a user isn't logged in to W&B. (default: `False`)
|
360
|
+
sync_tensorboard: (bool, optional) Synchronize wandb logs from tensorboard or
|
361
|
+
tensorboardX and save the relevant events file. (default: `False`)
|
362
|
+
tensorboard: (bool, optional) Alias for `sync_tensorboard`, deprecated.
|
363
|
+
monitor_gym: (bool, optional) Automatically log videos of environment when
|
364
|
+
using OpenAI Gym. (default: `False`)
|
365
|
+
See [our guide to this integration](https://docs.wandb.com/guides/integrations/openai-gym).
|
366
|
+
id: (str, optional) A unique ID for this run, used for resuming. It must
|
367
|
+
be unique in the project, and if you delete a run you can't reuse
|
368
|
+
the ID. Use the `name` field for a short descriptive name, or `config`
|
369
|
+
for saving hyperparameters to compare across runs. The ID cannot
|
370
|
+
contain the following special characters: `/\#?%:`.
|
371
|
+
See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming).
|
372
|
+
fork_from: (str, optional) A string with the format {run_id}?_step={step} describing
|
373
|
+
a moment in a previous run to fork a new run from. Creates a new run that picks up
|
374
|
+
logging history from the specified run at the specified moment. The target run must
|
375
|
+
be in the current project. Example: `fork_from="my-run-id?_step=1234"`.
|
376
|
+
resume_from: (str, optional) A string with the format {run_id}?_step={step} describing
|
377
|
+
a moment in a previous run to resume a run from. This allows users to truncate
|
378
|
+
the history logged to a run at an intermediate step and resume logging from that step.
|
379
|
+
It uses run forking under the hood. The target run must be in the
|
380
|
+
current project. Example: `resume_from="my-run-id?_step=1234"`.
|
381
|
+
settings: (dict, wandb.Settings, optional) Settings to use for this run. (default: None)
|
382
|
+
|
383
|
+
Examples:
|
384
|
+
### Set where the run is logged
|
385
|
+
|
386
|
+
You can change where the run is logged, just like changing
|
387
|
+
the organization, repository, and branch in git:
|
388
|
+
```python
|
389
|
+
import wandb
|
390
|
+
|
391
|
+
user = "geoff"
|
392
|
+
project = "capsules"
|
393
|
+
display_name = "experiment-2021-10-31"
|
394
|
+
|
395
|
+
wandb.init(entity=user, project=project, name=display_name)
|
396
|
+
```
|
397
|
+
|
398
|
+
### Add metadata about the run to the config
|
399
|
+
|
400
|
+
Pass a dictionary-style object as the `config` keyword argument to add
|
401
|
+
metadata, like hyperparameters, to your run.
|
402
|
+
<!--yeadoc-test:init-set-config-->
|
403
|
+
```python
|
404
|
+
import wandb
|
405
|
+
|
406
|
+
config = {"lr": 3e-4, "batch_size": 32}
|
407
|
+
config.update({"architecture": "resnet", "depth": 34})
|
408
|
+
wandb.init(config=config)
|
409
|
+
```
|
410
|
+
|
411
|
+
Raises:
|
412
|
+
Error: if some unknown or internal error happened during the run initialization.
|
413
|
+
AuthenticationError: if the user failed to provide valid credentials.
|
414
|
+
CommError: if there was a problem communicating with the WandB server.
|
415
|
+
UsageError: if the user provided invalid arguments.
|
416
|
+
KeyboardInterrupt: if user interrupts the run.
|
417
|
+
|
418
|
+
Returns:
|
419
|
+
A `Run` object.
|
420
|
+
"""
|
421
|
+
...
|
422
|
+
|
423
|
+
def finish(exit_code: Optional[int] = None, quiet: Optional[bool] = None) -> None:
|
424
|
+
"""Mark a run as finished, and finish uploading all data.
|
425
|
+
|
426
|
+
This is used when creating multiple runs in the same process.
|
427
|
+
We automatically call this method when your script exits.
|
428
|
+
|
429
|
+
Arguments:
|
430
|
+
exit_code: Set to something other than 0 to mark a run as failed
|
431
|
+
quiet: Set to true to minimize log output
|
432
|
+
"""
|
433
|
+
...
|
434
|
+
|
435
|
+
def login(
|
436
|
+
anonymous: Optional[Literal["must", "allow", "never"]] = None,
|
437
|
+
key: Optional[str] = None,
|
438
|
+
relogin: Optional[bool] = None,
|
439
|
+
host: Optional[str] = None,
|
440
|
+
force: Optional[bool] = None,
|
441
|
+
timeout: Optional[int] = None,
|
442
|
+
verify: bool = False,
|
443
|
+
) -> bool:
|
444
|
+
"""Set up W&B login credentials.
|
445
|
+
|
446
|
+
By default, this will only store credentials locally without
|
447
|
+
verifying them with the W&B server. To verify credentials, pass
|
448
|
+
`verify=True`.
|
449
|
+
|
450
|
+
Arguments:
|
451
|
+
anonymous: (string, optional) Can be "must", "allow", or "never".
|
452
|
+
If set to "must", always log a user in anonymously. If set to
|
453
|
+
"allow", only create an anonymous user if the user
|
454
|
+
isn't already logged in. If set to "never", never log a
|
455
|
+
user anonymously. Default set to "never".
|
456
|
+
key: (string, optional) The API key to use.
|
457
|
+
relogin: (bool, optional) If true, will re-prompt for API key.
|
458
|
+
host: (string, optional) The host to connect to.
|
459
|
+
force: (bool, optional) If true, will force a relogin.
|
460
|
+
timeout: (int, optional) Number of seconds to wait for user input.
|
461
|
+
verify: (bool) Verify the credentials with the W&B server.
|
462
|
+
|
463
|
+
Returns:
|
464
|
+
bool: if key is configured
|
465
|
+
|
466
|
+
Raises:
|
467
|
+
AuthenticationError - if api_key fails verification with the server
|
468
|
+
UsageError - if api_key cannot be configured and no tty
|
469
|
+
"""
|
470
|
+
...
|
471
|
+
|
472
|
+
def log(
|
473
|
+
data: Dict[str, Any],
|
474
|
+
step: Optional[int] = None,
|
475
|
+
commit: Optional[bool] = None,
|
476
|
+
sync: Optional[bool] = None,
|
477
|
+
) -> None:
|
478
|
+
"""Upload run data.
|
479
|
+
|
480
|
+
Use `log` to log data from runs, such as scalars, images, video,
|
481
|
+
histograms, plots, and tables.
|
482
|
+
|
483
|
+
See our [guides to logging](https://docs.wandb.ai/guides/track/log) for
|
484
|
+
live examples, code snippets, best practices, and more.
|
485
|
+
|
486
|
+
The most basic usage is `run.log({"train-loss": 0.5, "accuracy": 0.9})`.
|
487
|
+
This will save the loss and accuracy to the run's history and update
|
488
|
+
the summary values for these metrics.
|
489
|
+
|
490
|
+
Visualize logged data in the workspace at [wandb.ai](https://wandb.ai),
|
491
|
+
or locally on a [self-hosted instance](https://docs.wandb.ai/guides/hosting)
|
492
|
+
of the W&B app, or export data to visualize and explore locally, e.g. in
|
493
|
+
Jupyter notebooks, with [our API](https://docs.wandb.ai/guides/track/public-api-guide).
|
494
|
+
|
495
|
+
Logged values don't have to be scalars. Logging any wandb object is supported.
|
496
|
+
For example `run.log({"example": wandb.Image("myimage.jpg")})` will log an
|
497
|
+
example image which will be displayed nicely in the W&B UI.
|
498
|
+
See the [reference documentation](https://docs.wandb.com/ref/python/data-types)
|
499
|
+
for all of the different supported types or check out our
|
500
|
+
[guides to logging](https://docs.wandb.ai/guides/track/log) for examples,
|
501
|
+
from 3D molecular structures and segmentation masks to PR curves and histograms.
|
502
|
+
You can use `wandb.Table` to log structured data. See our
|
503
|
+
[guide to logging tables](https://docs.wandb.ai/guides/data-vis/log-tables)
|
504
|
+
for details.
|
505
|
+
|
506
|
+
The W&B UI organizes metrics with a forward slash (`/`) in their name
|
507
|
+
into sections named using the text before the final slash. For example,
|
508
|
+
the following results in two sections named "train" and "validate":
|
509
|
+
|
510
|
+
```
|
511
|
+
run.log({
|
512
|
+
"train/accuracy": 0.9,
|
513
|
+
"train/loss": 30,
|
514
|
+
"validate/accuracy": 0.8,
|
515
|
+
"validate/loss": 20,
|
516
|
+
})
|
517
|
+
```
|
518
|
+
|
519
|
+
Only one level of nesting is supported; `run.log({"a/b/c": 1})`
|
520
|
+
produces a section named "a/b".
|
521
|
+
|
522
|
+
`run.log` is not intended to be called more than a few times per second.
|
523
|
+
For optimal performance, limit your logging to once every N iterations,
|
524
|
+
or collect data over multiple iterations and log it in a single step.
|
525
|
+
|
526
|
+
### The W&B step
|
527
|
+
|
528
|
+
With basic usage, each call to `log` creates a new "step".
|
529
|
+
The step must always increase, and it is not possible to log
|
530
|
+
to a previous step.
|
531
|
+
|
532
|
+
Note that you can use any metric as the X axis in charts.
|
533
|
+
In many cases, it is better to treat the W&B step like
|
534
|
+
you'd treat a timestamp rather than a training step.
|
535
|
+
|
536
|
+
```
|
537
|
+
# Example: log an "epoch" metric for use as an X axis.
|
538
|
+
run.log({"epoch": 40, "train-loss": 0.5})
|
539
|
+
```
|
540
|
+
|
541
|
+
See also [define_metric](https://docs.wandb.ai/ref/python/run#define_metric).
|
542
|
+
|
543
|
+
It is possible to use multiple `log` invocations to log to
|
544
|
+
the same step with the `step` and `commit` parameters.
|
545
|
+
The following are all equivalent:
|
546
|
+
|
547
|
+
```
|
548
|
+
# Normal usage:
|
549
|
+
run.log({"train-loss": 0.5, "accuracy": 0.8})
|
550
|
+
run.log({"train-loss": 0.4, "accuracy": 0.9})
|
551
|
+
|
552
|
+
# Implicit step without auto-incrementing:
|
553
|
+
run.log({"train-loss": 0.5}, commit=False)
|
554
|
+
run.log({"accuracy": 0.8})
|
555
|
+
run.log({"train-loss": 0.4}, commit=False)
|
556
|
+
run.log({"accuracy": 0.9})
|
557
|
+
|
558
|
+
# Explicit step:
|
559
|
+
run.log({"train-loss": 0.5}, step=current_step)
|
560
|
+
run.log({"accuracy": 0.8}, step=current_step)
|
561
|
+
current_step += 1
|
562
|
+
run.log({"train-loss": 0.4}, step=current_step)
|
563
|
+
run.log({"accuracy": 0.9}, step=current_step)
|
564
|
+
```
|
565
|
+
|
566
|
+
Arguments:
|
567
|
+
data: A `dict` with `str` keys and values that are serializable
|
568
|
+
Python objects including: `int`, `float` and `string`;
|
569
|
+
any of the `wandb.data_types`; lists, tuples and NumPy arrays
|
570
|
+
of serializable Python objects; other `dict`s of this
|
571
|
+
structure.
|
572
|
+
step: The step number to log. If `None`, then an implicit
|
573
|
+
auto-incrementing step is used. See the notes in
|
574
|
+
the description.
|
575
|
+
commit: If true, finalize and upload the step. If false, then
|
576
|
+
accumulate data for the step. See the notes in the description.
|
577
|
+
If `step` is `None`, then the default is `commit=True`;
|
578
|
+
otherwise, the default is `commit=False`.
|
579
|
+
sync: This argument is deprecated and does nothing.
|
580
|
+
|
581
|
+
Examples:
|
582
|
+
For more and more detailed examples, see
|
583
|
+
[our guides to logging](https://docs.wandb.com/guides/track/log).
|
584
|
+
|
585
|
+
### Basic usage
|
586
|
+
<!--yeadoc-test:init-and-log-basic-->
|
587
|
+
```python
|
588
|
+
import wandb
|
589
|
+
|
590
|
+
run = wandb.init()
|
591
|
+
run.log({"accuracy": 0.9, "epoch": 5})
|
592
|
+
```
|
593
|
+
|
594
|
+
### Incremental logging
|
595
|
+
<!--yeadoc-test:init-and-log-incremental-->
|
596
|
+
```python
|
597
|
+
import wandb
|
598
|
+
|
599
|
+
run = wandb.init()
|
600
|
+
run.log({"loss": 0.2}, commit=False)
|
601
|
+
# Somewhere else when I'm ready to report this step:
|
602
|
+
run.log({"accuracy": 0.8})
|
603
|
+
```
|
604
|
+
|
605
|
+
### Histogram
|
606
|
+
<!--yeadoc-test:init-and-log-histogram-->
|
607
|
+
```python
|
608
|
+
import numpy as np
|
609
|
+
import wandb
|
610
|
+
|
611
|
+
# sample gradients at random from normal distribution
|
612
|
+
gradients = np.random.randn(100, 100)
|
613
|
+
run = wandb.init()
|
614
|
+
run.log({"gradients": wandb.Histogram(gradients)})
|
615
|
+
```
|
616
|
+
|
617
|
+
### Image from numpy
|
618
|
+
<!--yeadoc-test:init-and-log-image-numpy-->
|
619
|
+
```python
|
620
|
+
import numpy as np
|
621
|
+
import wandb
|
622
|
+
|
623
|
+
run = wandb.init()
|
624
|
+
examples = []
|
625
|
+
for i in range(3):
|
626
|
+
pixels = np.random.randint(low=0, high=256, size=(100, 100, 3))
|
627
|
+
image = wandb.Image(pixels, caption=f"random field {i}")
|
628
|
+
examples.append(image)
|
629
|
+
run.log({"examples": examples})
|
630
|
+
```
|
631
|
+
|
632
|
+
### Image from PIL
|
633
|
+
<!--yeadoc-test:init-and-log-image-pillow-->
|
634
|
+
```python
|
635
|
+
import numpy as np
|
636
|
+
from PIL import Image as PILImage
|
637
|
+
import wandb
|
638
|
+
|
639
|
+
run = wandb.init()
|
640
|
+
examples = []
|
641
|
+
for i in range(3):
|
642
|
+
pixels = np.random.randint(low=0, high=256, size=(100, 100, 3), dtype=np.uint8)
|
643
|
+
pil_image = PILImage.fromarray(pixels, mode="RGB")
|
644
|
+
image = wandb.Image(pil_image, caption=f"random field {i}")
|
645
|
+
examples.append(image)
|
646
|
+
run.log({"examples": examples})
|
647
|
+
```
|
648
|
+
|
649
|
+
### Video from numpy
|
650
|
+
<!--yeadoc-test:init-and-log-video-numpy-->
|
651
|
+
```python
|
652
|
+
import numpy as np
|
653
|
+
import wandb
|
654
|
+
|
655
|
+
run = wandb.init()
|
656
|
+
# axes are (time, channel, height, width)
|
657
|
+
frames = np.random.randint(low=0, high=256, size=(10, 3, 100, 100), dtype=np.uint8)
|
658
|
+
run.log({"video": wandb.Video(frames, fps=4)})
|
659
|
+
```
|
660
|
+
|
661
|
+
### Matplotlib Plot
|
662
|
+
<!--yeadoc-test:init-and-log-matplotlib-->
|
663
|
+
```python
|
664
|
+
from matplotlib import pyplot as plt
|
665
|
+
import numpy as np
|
666
|
+
import wandb
|
667
|
+
|
668
|
+
run = wandb.init()
|
669
|
+
fig, ax = plt.subplots()
|
670
|
+
x = np.linspace(0, 10)
|
671
|
+
y = x * x
|
672
|
+
ax.plot(x, y) # plot y = x^2
|
673
|
+
run.log({"chart": fig})
|
674
|
+
```
|
675
|
+
|
676
|
+
### PR Curve
|
677
|
+
```python
|
678
|
+
import wandb
|
679
|
+
|
680
|
+
run = wandb.init()
|
681
|
+
run.log({"pr": wandb.plot.pr_curve(y_test, y_probas, labels)})
|
682
|
+
```
|
683
|
+
|
684
|
+
### 3D Object
|
685
|
+
```python
|
686
|
+
import wandb
|
687
|
+
|
688
|
+
run = wandb.init()
|
689
|
+
run.log(
|
690
|
+
{
|
691
|
+
"generated_samples": [
|
692
|
+
wandb.Object3D(open("sample.obj")),
|
693
|
+
wandb.Object3D(open("sample.gltf")),
|
694
|
+
wandb.Object3D(open("sample.glb")),
|
695
|
+
]
|
696
|
+
}
|
697
|
+
)
|
698
|
+
```
|
699
|
+
|
700
|
+
Raises:
|
701
|
+
wandb.Error: if called before `wandb.init`
|
702
|
+
ValueError: if invalid data is passed
|
703
|
+
"""
|
704
|
+
...
|
705
|
+
|
706
|
+
def save(
|
707
|
+
glob_str: Optional[Union[str, os.PathLike]] = None,
|
708
|
+
base_path: Optional[Union[str, os.PathLike]] = None,
|
709
|
+
policy: PolicyName = "live",
|
710
|
+
) -> Union[bool, List[str]]:
|
711
|
+
"""Sync one or more files to W&B.
|
712
|
+
|
713
|
+
Relative paths are relative to the current working directory.
|
714
|
+
|
715
|
+
A Unix glob, such as "myfiles/*", is expanded at the time `save` is
|
716
|
+
called regardless of the `policy`. In particular, new files are not
|
717
|
+
picked up automatically.
|
718
|
+
|
719
|
+
A `base_path` may be provided to control the directory structure of
|
720
|
+
uploaded files. It should be a prefix of `glob_str`, and the directory
|
721
|
+
structure beneath it is preserved. It's best understood through
|
722
|
+
examples:
|
723
|
+
|
724
|
+
```
|
725
|
+
wandb.save("these/are/myfiles/*")
|
726
|
+
# => Saves files in a "these/are/myfiles/" folder in the run.
|
727
|
+
|
728
|
+
wandb.save("these/are/myfiles/*", base_path="these")
|
729
|
+
# => Saves files in an "are/myfiles/" folder in the run.
|
730
|
+
|
731
|
+
wandb.save("/User/username/Documents/run123/*.txt")
|
732
|
+
# => Saves files in a "run123/" folder in the run. See note below.
|
733
|
+
|
734
|
+
wandb.save("/User/username/Documents/run123/*.txt", base_path="/User")
|
735
|
+
# => Saves files in a "username/Documents/run123/" folder in the run.
|
736
|
+
|
737
|
+
wandb.save("files/*/saveme.txt")
|
738
|
+
# => Saves each "saveme.txt" file in an appropriate subdirectory
|
739
|
+
# of "files/".
|
740
|
+
```
|
741
|
+
|
742
|
+
Note: when given an absolute path or glob and no `base_path`, one
|
743
|
+
directory level is preserved as in the example above.
|
744
|
+
|
745
|
+
Arguments:
|
746
|
+
glob_str: A relative or absolute path or Unix glob.
|
747
|
+
base_path: A path to use to infer a directory structure; see examples.
|
748
|
+
policy: One of `live`, `now`, or `end`.
|
749
|
+
* live: upload the file as it changes, overwriting the previous version
|
750
|
+
* now: upload the file once now
|
751
|
+
* end: upload file when the run ends
|
752
|
+
|
753
|
+
Returns:
|
754
|
+
Paths to the symlinks created for the matched files.
|
755
|
+
|
756
|
+
For historical reasons, this may return a boolean in legacy code.
|
757
|
+
"""
|
758
|
+
...
|
759
|
+
|
760
|
+
def sweep(
|
761
|
+
sweep: Union[dict, Callable],
|
762
|
+
entity: Optional[str] = None,
|
763
|
+
project: Optional[str] = None,
|
764
|
+
prior_runs: Optional[List[str]] = None,
|
765
|
+
) -> str:
|
766
|
+
"""Initialize a hyperparameter sweep.
|
767
|
+
|
768
|
+
Search for hyperparameters that optimizes a cost function
|
769
|
+
of a machine learning model by testing various combinations.
|
770
|
+
|
771
|
+
Make note the unique identifier, `sweep_id`, that is returned.
|
772
|
+
At a later step provide the `sweep_id` to a sweep agent.
|
773
|
+
|
774
|
+
Args:
|
775
|
+
sweep: The configuration of a hyperparameter search.
|
776
|
+
(or configuration generator). See
|
777
|
+
[Sweep configuration structure](https://docs.wandb.ai/guides/sweeps/define-sweep-configuration)
|
778
|
+
for information on how to define your sweep.
|
779
|
+
If you provide a callable, ensure that the callable does
|
780
|
+
not take arguments and that it returns a dictionary that
|
781
|
+
conforms to the W&B sweep config spec.
|
782
|
+
entity: The username or team name where you want to send W&B
|
783
|
+
runs created by the sweep to. Ensure that the entity you
|
784
|
+
specify already exists. If you don't specify an entity,
|
785
|
+
the run will be sent to your default entity,
|
786
|
+
which is usually your username.
|
787
|
+
project: The name of the project where W&B runs created from
|
788
|
+
the sweep are sent to. If the project is not specified, the
|
789
|
+
run is sent to a project labeled 'Uncategorized'.
|
790
|
+
prior_runs: The run IDs of existing runs to add to this sweep.
|
791
|
+
|
792
|
+
Returns:
|
793
|
+
sweep_id: str. A unique identifier for the sweep.
|
794
|
+
"""
|
795
|
+
...
|
796
|
+
|
797
|
+
def controller(
|
798
|
+
sweep_id_or_config: Optional[Union[str, Dict]] = None,
|
799
|
+
entity: Optional[str] = None,
|
800
|
+
project: Optional[str] = None,
|
801
|
+
) -> _WandbController:
|
802
|
+
"""Public sweep controller constructor.
|
803
|
+
|
804
|
+
Usage:
|
805
|
+
```python
|
806
|
+
import wandb
|
807
|
+
|
808
|
+
tuner = wandb.controller(...)
|
809
|
+
print(tuner.sweep_config)
|
810
|
+
print(tuner.sweep_id)
|
811
|
+
tuner.configure_search(...)
|
812
|
+
tuner.configure_stopping(...)
|
813
|
+
```
|
814
|
+
"""
|
815
|
+
...
|
816
|
+
|
817
|
+
def agent(
|
818
|
+
sweep_id: str,
|
819
|
+
function: Optional[Callable] = None,
|
820
|
+
entity: Optional[str] = None,
|
821
|
+
project: Optional[str] = None,
|
822
|
+
count: Optional[int] = None,
|
823
|
+
) -> None:
|
824
|
+
"""Start one or more sweep agents.
|
825
|
+
|
826
|
+
The sweep agent uses the `sweep_id` to know which sweep it
|
827
|
+
is a part of, what function to execute, and (optionally) how
|
828
|
+
many agents to run.
|
829
|
+
|
830
|
+
Arguments:
|
831
|
+
sweep_id: The unique identifier for a sweep. A sweep ID
|
832
|
+
is generated by W&B CLI or Python SDK.
|
833
|
+
function: A function to call instead of the "program"
|
834
|
+
specified in the sweep config.
|
835
|
+
entity: The username or team name where you want to send W&B
|
836
|
+
runs created by the sweep to. Ensure that the entity you
|
837
|
+
specify already exists. If you don't specify an entity,
|
838
|
+
the run will be sent to your default entity,
|
839
|
+
which is usually your username.
|
840
|
+
project: The name of the project where W&B runs created from
|
841
|
+
the sweep are sent to. If the project is not specified, the
|
842
|
+
run is sent to a project labeled "Uncategorized".
|
843
|
+
count: The number of sweep config trials to try.
|
844
|
+
"""
|
845
|
+
...
|
846
|
+
|
847
|
+
def define_metric(
|
848
|
+
name: str,
|
849
|
+
step_metric: Union[str, wandb_metric.Metric, None] = None,
|
850
|
+
step_sync: Optional[bool] = None,
|
851
|
+
hidden: Optional[bool] = None,
|
852
|
+
summary: Optional[str] = None,
|
853
|
+
goal: Optional[str] = None,
|
854
|
+
overwrite: Optional[bool] = None,
|
855
|
+
) -> wandb_metric.Metric:
|
856
|
+
"""Customize metrics logged with `wandb.log()`.
|
857
|
+
|
858
|
+
Arguments:
|
859
|
+
name: The name of the metric to customize.
|
860
|
+
step_metric: The name of another metric to serve as the X-axis
|
861
|
+
for this metric in automatically generated charts.
|
862
|
+
step_sync: Automatically insert the last value of step_metric into
|
863
|
+
`run.log()` if it is not provided explicitly. Defaults to True
|
864
|
+
if step_metric is specified.
|
865
|
+
hidden: Hide this metric from automatic plots.
|
866
|
+
summary: Specify aggregate metrics added to summary.
|
867
|
+
Supported aggregations include "min", "max", "mean", "last",
|
868
|
+
"best", "copy" and "none". "best" is used together with the
|
869
|
+
goal parameter. "none" prevents a summary from being generated.
|
870
|
+
"copy" is deprecated and should not be used.
|
871
|
+
goal: Specify how to interpret the "best" summary type.
|
872
|
+
Supported options are "minimize" and "maximize".
|
873
|
+
overwrite: If false, then this call is merged with previous
|
874
|
+
`define_metric` calls for the same metric by using their
|
875
|
+
values for any unspecified parameters. If true, then
|
876
|
+
unspecified parameters overwrite values specified by
|
877
|
+
previous calls.
|
878
|
+
|
879
|
+
Returns:
|
880
|
+
An object that represents this call but can otherwise be discarded.
|
881
|
+
"""
|
882
|
+
...
|
883
|
+
|
884
|
+
def log_artifact(
|
885
|
+
artifact_or_path: Union[Artifact, StrPath],
|
886
|
+
name: Optional[str] = None,
|
887
|
+
type: Optional[str] = None,
|
888
|
+
aliases: Optional[List[str]] = None,
|
889
|
+
tags: Optional[List[str]] = None,
|
890
|
+
) -> Artifact:
|
891
|
+
"""Declare an artifact as an output of a run.
|
892
|
+
|
893
|
+
Arguments:
|
894
|
+
artifact_or_path: (str or Artifact) A path to the contents of this artifact,
|
895
|
+
can be in the following forms:
|
896
|
+
- `/local/directory`
|
897
|
+
- `/local/directory/file.txt`
|
898
|
+
- `s3://bucket/path`
|
899
|
+
You can also pass an Artifact object created by calling
|
900
|
+
`wandb.Artifact`.
|
901
|
+
name: (str, optional) An artifact name. Valid names can be in the following forms:
|
902
|
+
- name:version
|
903
|
+
- name:alias
|
904
|
+
- digest
|
905
|
+
This will default to the basename of the path prepended with the current
|
906
|
+
run id if not specified.
|
907
|
+
type: (str) The type of artifact to log, examples include `dataset`, `model`
|
908
|
+
aliases: (list, optional) Aliases to apply to this artifact,
|
909
|
+
defaults to `["latest"]`
|
910
|
+
tags: (list, optional) Tags to apply to this artifact, if any.
|
911
|
+
|
912
|
+
Returns:
|
913
|
+
An `Artifact` object.
|
914
|
+
"""
|
915
|
+
...
|
916
|
+
|
917
|
+
def use_artifact(
|
918
|
+
artifact_or_name: Union[str, Artifact],
|
919
|
+
type: Optional[str] = None,
|
920
|
+
aliases: Optional[List[str]] = None,
|
921
|
+
use_as: Optional[str] = None,
|
922
|
+
) -> Artifact:
|
923
|
+
"""Declare an artifact as an input to a run.
|
924
|
+
|
925
|
+
Call `download` or `file` on the returned object to get the contents locally.
|
926
|
+
|
927
|
+
Arguments:
|
928
|
+
artifact_or_name: (str or Artifact) An artifact name.
|
929
|
+
May be prefixed with entity/project/. Valid names
|
930
|
+
can be in the following forms:
|
931
|
+
- name:version
|
932
|
+
- name:alias
|
933
|
+
You can also pass an Artifact object created by calling `wandb.Artifact`
|
934
|
+
type: (str, optional) The type of artifact to use.
|
935
|
+
aliases: (list, optional) Aliases to apply to this artifact
|
936
|
+
use_as: (string, optional) Optional string indicating what purpose the artifact was used with.
|
937
|
+
Will be shown in UI.
|
938
|
+
|
939
|
+
Returns:
|
940
|
+
An `Artifact` object.
|
941
|
+
"""
|
942
|
+
...
|
943
|
+
|
944
|
+
def log_model(
|
945
|
+
path: StrPath,
|
946
|
+
name: Optional[str] = None,
|
947
|
+
aliases: Optional[List[str]] = None,
|
948
|
+
) -> None:
|
949
|
+
"""Logs a model artifact containing the contents inside the 'path' to a run and marks it as an output to this run.
|
950
|
+
|
951
|
+
Arguments:
|
952
|
+
path: (str) A path to the contents of this model,
|
953
|
+
can be in the following forms:
|
954
|
+
- `/local/directory`
|
955
|
+
- `/local/directory/file.txt`
|
956
|
+
- `s3://bucket/path`
|
957
|
+
name: (str, optional) A name to assign to the model artifact that the file contents will be added to.
|
958
|
+
The string must contain only the following alphanumeric characters: dashes, underscores, and dots.
|
959
|
+
This will default to the basename of the path prepended with the current
|
960
|
+
run id if not specified.
|
961
|
+
aliases: (list, optional) Aliases to apply to the created model artifact,
|
962
|
+
defaults to `["latest"]`
|
963
|
+
|
964
|
+
Examples:
|
965
|
+
```python
|
966
|
+
run.log_model(
|
967
|
+
path="/local/directory",
|
968
|
+
name="my_model_artifact",
|
969
|
+
aliases=["production"],
|
970
|
+
)
|
971
|
+
```
|
972
|
+
|
973
|
+
Invalid usage
|
974
|
+
```python
|
975
|
+
run.log_model(
|
976
|
+
path="/local/directory",
|
977
|
+
name="my_entity/my_project/my_model_artifact",
|
978
|
+
aliases=["production"],
|
979
|
+
)
|
980
|
+
```
|
981
|
+
|
982
|
+
Raises:
|
983
|
+
ValueError: if name has invalid special characters
|
984
|
+
|
985
|
+
Returns:
|
986
|
+
None
|
987
|
+
"""
|
988
|
+
...
|
989
|
+
|
990
|
+
def use_model(name: str) -> FilePathStr:
|
991
|
+
"""Download the files logged in a model artifact 'name'.
|
992
|
+
|
993
|
+
Arguments:
|
994
|
+
name: (str) A model artifact name. 'name' must match the name of an existing logged
|
995
|
+
model artifact.
|
996
|
+
May be prefixed with entity/project/. Valid names
|
997
|
+
can be in the following forms:
|
998
|
+
- model_artifact_name:version
|
999
|
+
- model_artifact_name:alias
|
1000
|
+
|
1001
|
+
Examples:
|
1002
|
+
```python
|
1003
|
+
run.use_model(
|
1004
|
+
name="my_model_artifact:latest",
|
1005
|
+
)
|
1006
|
+
|
1007
|
+
run.use_model(
|
1008
|
+
name="my_project/my_model_artifact:v0",
|
1009
|
+
)
|
1010
|
+
|
1011
|
+
run.use_model(
|
1012
|
+
name="my_entity/my_project/my_model_artifact:<digest>",
|
1013
|
+
)
|
1014
|
+
```
|
1015
|
+
|
1016
|
+
Invalid usage
|
1017
|
+
```python
|
1018
|
+
run.use_model(
|
1019
|
+
name="my_entity/my_project/my_model_artifact",
|
1020
|
+
)
|
1021
|
+
```
|
1022
|
+
|
1023
|
+
Raises:
|
1024
|
+
AssertionError: if model artifact 'name' is of a type that does not contain the substring 'model'.
|
1025
|
+
|
1026
|
+
Returns:
|
1027
|
+
path: (str) path to downloaded model artifact file(s).
|
1028
|
+
"""
|
1029
|
+
...
|
1030
|
+
|
1031
|
+
def link_model(
|
1032
|
+
path: StrPath,
|
1033
|
+
registered_model_name: str,
|
1034
|
+
name: Optional[str] = None,
|
1035
|
+
aliases: Optional[List[str]] = None,
|
1036
|
+
) -> None:
|
1037
|
+
"""Log a model artifact version and link it to a registered model in the model registry.
|
1038
|
+
|
1039
|
+
The linked model version will be visible in the UI for the specified registered model.
|
1040
|
+
|
1041
|
+
Steps:
|
1042
|
+
- Check if 'name' model artifact has been logged. If so, use the artifact version that matches the files
|
1043
|
+
located at 'path' or log a new version. Otherwise log files under 'path' as a new model artifact, 'name'
|
1044
|
+
of type 'model'.
|
1045
|
+
- Check if registered model with name 'registered_model_name' exists in the 'model-registry' project.
|
1046
|
+
If not, create a new registered model with name 'registered_model_name'.
|
1047
|
+
- Link version of model artifact 'name' to registered model, 'registered_model_name'.
|
1048
|
+
- Attach aliases from 'aliases' list to the newly linked model artifact version.
|
1049
|
+
|
1050
|
+
Arguments:
|
1051
|
+
path: (str) A path to the contents of this model,
|
1052
|
+
can be in the following forms:
|
1053
|
+
- `/local/directory`
|
1054
|
+
- `/local/directory/file.txt`
|
1055
|
+
- `s3://bucket/path`
|
1056
|
+
registered_model_name: (str) - the name of the registered model that the model is to be linked to.
|
1057
|
+
A registered model is a collection of model versions linked to the model registry, typically representing a
|
1058
|
+
team's specific ML Task. The entity that this registered model belongs to will be derived from the run
|
1059
|
+
name: (str, optional) - the name of the model artifact that files in 'path' will be logged to. This will
|
1060
|
+
default to the basename of the path prepended with the current run id if not specified.
|
1061
|
+
aliases: (List[str], optional) - alias(es) that will only be applied on this linked artifact
|
1062
|
+
inside the registered model.
|
1063
|
+
The alias "latest" will always be applied to the latest version of an artifact that is linked.
|
1064
|
+
|
1065
|
+
Examples:
|
1066
|
+
```python
|
1067
|
+
run.link_model(
|
1068
|
+
path="/local/directory",
|
1069
|
+
registered_model_name="my_reg_model",
|
1070
|
+
name="my_model_artifact",
|
1071
|
+
aliases=["production"],
|
1072
|
+
)
|
1073
|
+
```
|
1074
|
+
|
1075
|
+
Invalid usage
|
1076
|
+
```python
|
1077
|
+
run.link_model(
|
1078
|
+
path="/local/directory",
|
1079
|
+
registered_model_name="my_entity/my_project/my_reg_model",
|
1080
|
+
name="my_model_artifact",
|
1081
|
+
aliases=["production"],
|
1082
|
+
)
|
1083
|
+
|
1084
|
+
run.link_model(
|
1085
|
+
path="/local/directory",
|
1086
|
+
registered_model_name="my_reg_model",
|
1087
|
+
name="my_entity/my_project/my_model_artifact",
|
1088
|
+
aliases=["production"],
|
1089
|
+
)
|
1090
|
+
```
|
1091
|
+
|
1092
|
+
Raises:
|
1093
|
+
AssertionError: if registered_model_name is a path or
|
1094
|
+
if model artifact 'name' is of a type that does not contain the substring 'model'
|
1095
|
+
ValueError: if name has invalid special characters
|
1096
|
+
|
1097
|
+
Returns:
|
1098
|
+
None
|
1099
|
+
"""
|
1100
|
+
...
|
1101
|
+
|
1102
|
+
def watch(
|
1103
|
+
models: torch.nn.Module | Sequence[torch.nn.Module],
|
1104
|
+
criterion: torch.F | None = None,
|
1105
|
+
log: Literal["gradients", "parameters", "all"] | None = "gradients",
|
1106
|
+
log_freq: int = 1000,
|
1107
|
+
idx: int | None = None,
|
1108
|
+
log_graph: bool = False,
|
1109
|
+
) -> Graph:
|
1110
|
+
"""Hooks into the given PyTorch model(s) to monitor gradients and the model's computational graph.
|
1111
|
+
|
1112
|
+
This function can track parameters, gradients, or both during training. It should be
|
1113
|
+
extended to support arbitrary machine learning models in the future.
|
1114
|
+
|
1115
|
+
Args:
|
1116
|
+
models (Union[torch.nn.Module, Sequence[torch.nn.Module]]):
|
1117
|
+
A single model or a sequence of models to be monitored.
|
1118
|
+
criterion (Optional[torch.F]):
|
1119
|
+
The loss function being optimized (optional).
|
1120
|
+
log (Optional[Literal["gradients", "parameters", "all"]]):
|
1121
|
+
Specifies whether to log "gradients", "parameters", or "all".
|
1122
|
+
Set to None to disable logging. (default="gradients")
|
1123
|
+
log_freq (int):
|
1124
|
+
Frequency (in batches) to log gradients and parameters. (default=1000)
|
1125
|
+
idx (Optional[int]):
|
1126
|
+
Index used when tracking multiple models with `wandb.watch`. (default=None)
|
1127
|
+
log_graph (bool):
|
1128
|
+
Whether to log the model's computational graph. (default=False)
|
1129
|
+
|
1130
|
+
Returns:
|
1131
|
+
wandb.Graph:
|
1132
|
+
The graph object, which will be populated after the first backward pass.
|
1133
|
+
|
1134
|
+
Raises:
|
1135
|
+
ValueError:
|
1136
|
+
If `wandb.init` has not been called or if any of the models are not instances
|
1137
|
+
of `torch.nn.Module`.
|
1138
|
+
"""
|
1139
|
+
...
|