wandb 0.18.2__py3-none-musllinux_1_2_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -0,0 +1,405 @@
|
|
1
|
+
import codecs
|
2
|
+
import os
|
3
|
+
import pprint
|
4
|
+
|
5
|
+
from wandb import util
|
6
|
+
from wandb.sdk.data_types._private import MEDIA_TMP
|
7
|
+
from wandb.sdk.data_types.base_types.media import Media, _numpy_arrays_to_lists
|
8
|
+
from wandb.sdk.data_types.base_types.wb_value import WBValue
|
9
|
+
from wandb.sdk.lib import runid
|
10
|
+
|
11
|
+
|
12
|
+
def _nest(thing):
|
13
|
+
# Use tensorflows nest function if available, otherwise just wrap object in an array"""
|
14
|
+
|
15
|
+
tfutil = util.get_module("tensorflow.python.util")
|
16
|
+
if tfutil:
|
17
|
+
return tfutil.nest.flatten(thing)
|
18
|
+
else:
|
19
|
+
return [thing]
|
20
|
+
|
21
|
+
|
22
|
+
class Edge(WBValue):
|
23
|
+
"""Edge used in `Graph`."""
|
24
|
+
|
25
|
+
def __init__(self, from_node, to_node):
|
26
|
+
self._attributes = {}
|
27
|
+
self.from_node = from_node
|
28
|
+
self.to_node = to_node
|
29
|
+
|
30
|
+
def __repr__(self):
|
31
|
+
temp_attr = dict(self._attributes)
|
32
|
+
del temp_attr["from_node"]
|
33
|
+
del temp_attr["to_node"]
|
34
|
+
temp_attr["from_id"] = self.from_node.id
|
35
|
+
temp_attr["to_id"] = self.to_node.id
|
36
|
+
return str(temp_attr)
|
37
|
+
|
38
|
+
def to_json(self, run=None):
|
39
|
+
return [self.from_node.id, self.to_node.id]
|
40
|
+
|
41
|
+
@property
|
42
|
+
def name(self):
|
43
|
+
"""Optional, not necessarily unique."""
|
44
|
+
return self._attributes.get("name")
|
45
|
+
|
46
|
+
@name.setter
|
47
|
+
def name(self, val):
|
48
|
+
self._attributes["name"] = val
|
49
|
+
return val
|
50
|
+
|
51
|
+
@property
|
52
|
+
def from_node(self):
|
53
|
+
return self._attributes.get("from_node")
|
54
|
+
|
55
|
+
@from_node.setter
|
56
|
+
def from_node(self, val):
|
57
|
+
self._attributes["from_node"] = val
|
58
|
+
return val
|
59
|
+
|
60
|
+
@property
|
61
|
+
def to_node(self):
|
62
|
+
return self._attributes.get("to_node")
|
63
|
+
|
64
|
+
@to_node.setter
|
65
|
+
def to_node(self, val):
|
66
|
+
self._attributes["to_node"] = val
|
67
|
+
return val
|
68
|
+
|
69
|
+
|
70
|
+
class Node(WBValue):
|
71
|
+
"""Node used in `Graph`."""
|
72
|
+
|
73
|
+
def __init__(
|
74
|
+
self,
|
75
|
+
id=None,
|
76
|
+
name=None,
|
77
|
+
class_name=None,
|
78
|
+
size=None,
|
79
|
+
parameters=None,
|
80
|
+
output_shape=None,
|
81
|
+
is_output=None,
|
82
|
+
num_parameters=None,
|
83
|
+
node=None,
|
84
|
+
):
|
85
|
+
self._attributes = {"name": None}
|
86
|
+
self.in_edges = {} # indexed by source node id
|
87
|
+
self.out_edges = {} # indexed by dest node id
|
88
|
+
# optional object (e.g. PyTorch Parameter or Module) that this Node represents
|
89
|
+
self.obj = None
|
90
|
+
|
91
|
+
if node is not None:
|
92
|
+
self._attributes.update(node._attributes)
|
93
|
+
del self._attributes["id"]
|
94
|
+
self.obj = node.obj
|
95
|
+
|
96
|
+
if id is not None:
|
97
|
+
self.id = id
|
98
|
+
if name is not None:
|
99
|
+
self.name = name
|
100
|
+
if class_name is not None:
|
101
|
+
self.class_name = class_name
|
102
|
+
if size is not None:
|
103
|
+
self.size = size
|
104
|
+
if parameters is not None:
|
105
|
+
self.parameters = parameters
|
106
|
+
if output_shape is not None:
|
107
|
+
self.output_shape = output_shape
|
108
|
+
if is_output is not None:
|
109
|
+
self.is_output = is_output
|
110
|
+
if num_parameters is not None:
|
111
|
+
self.num_parameters = num_parameters
|
112
|
+
|
113
|
+
def to_json(self, run=None):
|
114
|
+
return self._attributes
|
115
|
+
|
116
|
+
def __repr__(self):
|
117
|
+
return repr(self._attributes)
|
118
|
+
|
119
|
+
@property
|
120
|
+
def id(self):
|
121
|
+
"""Must be unique in the graph."""
|
122
|
+
return self._attributes.get("id")
|
123
|
+
|
124
|
+
@id.setter
|
125
|
+
def id(self, val):
|
126
|
+
self._attributes["id"] = val
|
127
|
+
return val
|
128
|
+
|
129
|
+
@property
|
130
|
+
def name(self):
|
131
|
+
"""Usually the type of layer or sublayer."""
|
132
|
+
return self._attributes.get("name")
|
133
|
+
|
134
|
+
@name.setter
|
135
|
+
def name(self, val):
|
136
|
+
self._attributes["name"] = val
|
137
|
+
return val
|
138
|
+
|
139
|
+
@property
|
140
|
+
def class_name(self):
|
141
|
+
"""Usually the type of layer or sublayer."""
|
142
|
+
return self._attributes.get("class_name")
|
143
|
+
|
144
|
+
@class_name.setter
|
145
|
+
def class_name(self, val):
|
146
|
+
self._attributes["class_name"] = val
|
147
|
+
return val
|
148
|
+
|
149
|
+
@property
|
150
|
+
def functions(self):
|
151
|
+
return self._attributes.get("functions", [])
|
152
|
+
|
153
|
+
@functions.setter
|
154
|
+
def functions(self, val):
|
155
|
+
self._attributes["functions"] = val
|
156
|
+
return val
|
157
|
+
|
158
|
+
@property
|
159
|
+
def parameters(self):
|
160
|
+
return self._attributes.get("parameters", [])
|
161
|
+
|
162
|
+
@parameters.setter
|
163
|
+
def parameters(self, val):
|
164
|
+
self._attributes["parameters"] = val
|
165
|
+
return val
|
166
|
+
|
167
|
+
@property
|
168
|
+
def size(self):
|
169
|
+
return self._attributes.get("size")
|
170
|
+
|
171
|
+
@size.setter
|
172
|
+
def size(self, val):
|
173
|
+
"""Tensor size."""
|
174
|
+
self._attributes["size"] = tuple(val)
|
175
|
+
return val
|
176
|
+
|
177
|
+
@property
|
178
|
+
def output_shape(self):
|
179
|
+
return self._attributes.get("output_shape")
|
180
|
+
|
181
|
+
@output_shape.setter
|
182
|
+
def output_shape(self, val):
|
183
|
+
"""Tensor output_shape."""
|
184
|
+
self._attributes["output_shape"] = val
|
185
|
+
return val
|
186
|
+
|
187
|
+
@property
|
188
|
+
def is_output(self):
|
189
|
+
return self._attributes.get("is_output")
|
190
|
+
|
191
|
+
@is_output.setter
|
192
|
+
def is_output(self, val):
|
193
|
+
"""Tensor is_output."""
|
194
|
+
self._attributes["is_output"] = val
|
195
|
+
return val
|
196
|
+
|
197
|
+
@property
|
198
|
+
def num_parameters(self):
|
199
|
+
return self._attributes.get("num_parameters")
|
200
|
+
|
201
|
+
@num_parameters.setter
|
202
|
+
def num_parameters(self, val):
|
203
|
+
"""Tensor num_parameters."""
|
204
|
+
self._attributes["num_parameters"] = val
|
205
|
+
return val
|
206
|
+
|
207
|
+
@property
|
208
|
+
def child_parameters(self):
|
209
|
+
return self._attributes.get("child_parameters")
|
210
|
+
|
211
|
+
@child_parameters.setter
|
212
|
+
def child_parameters(self, val):
|
213
|
+
"""Tensor child_parameters."""
|
214
|
+
self._attributes["child_parameters"] = val
|
215
|
+
return val
|
216
|
+
|
217
|
+
@property
|
218
|
+
def is_constant(self):
|
219
|
+
return self._attributes.get("is_constant")
|
220
|
+
|
221
|
+
@is_constant.setter
|
222
|
+
def is_constant(self, val):
|
223
|
+
"""Tensor is_constant."""
|
224
|
+
self._attributes["is_constant"] = val
|
225
|
+
return val
|
226
|
+
|
227
|
+
@classmethod
|
228
|
+
def from_keras(cls, layer):
|
229
|
+
node = cls()
|
230
|
+
|
231
|
+
try:
|
232
|
+
output_shape = layer.output_shape
|
233
|
+
except AttributeError:
|
234
|
+
output_shape = ["multiple"]
|
235
|
+
|
236
|
+
node.id = layer.name
|
237
|
+
node.name = layer.name
|
238
|
+
node.class_name = layer.__class__.__name__
|
239
|
+
node.output_shape = output_shape
|
240
|
+
node.num_parameters = layer.count_params()
|
241
|
+
|
242
|
+
return node
|
243
|
+
|
244
|
+
|
245
|
+
class Graph(Media):
|
246
|
+
"""Wandb class for graphs.
|
247
|
+
|
248
|
+
This class is typically used for saving and displaying neural net models. It
|
249
|
+
represents the graph as an array of nodes and edges. The nodes can have
|
250
|
+
labels that can be visualized by wandb.
|
251
|
+
|
252
|
+
Examples:
|
253
|
+
Import a keras model:
|
254
|
+
```
|
255
|
+
Graph.from_keras(keras_model)
|
256
|
+
```
|
257
|
+
|
258
|
+
Attributes:
|
259
|
+
format (string): Format to help wandb display the graph nicely.
|
260
|
+
nodes ([wandb.Node]): List of wandb.Nodes
|
261
|
+
nodes_by_id (dict): dict of ids -> nodes
|
262
|
+
edges ([(wandb.Node, wandb.Node)]): List of pairs of nodes interpreted as edges
|
263
|
+
loaded (boolean): Flag to tell whether the graph is completely loaded
|
264
|
+
root (wandb.Node): root node of the graph
|
265
|
+
"""
|
266
|
+
|
267
|
+
_log_type = "graph-file"
|
268
|
+
|
269
|
+
def __init__(self, format="keras"):
|
270
|
+
super().__init__()
|
271
|
+
# LB: TODO: I think we should factor criterion and criterion_passed out
|
272
|
+
self.format = format
|
273
|
+
self.nodes = []
|
274
|
+
self.nodes_by_id = {}
|
275
|
+
self.edges = []
|
276
|
+
self.loaded = False
|
277
|
+
self.criterion = None
|
278
|
+
self.criterion_passed = False
|
279
|
+
self.root = None # optional root Node if applicable
|
280
|
+
|
281
|
+
def _to_graph_json(self, run=None):
|
282
|
+
# Needs to be its own function for tests
|
283
|
+
return {
|
284
|
+
"format": self.format,
|
285
|
+
"nodes": [node.to_json() for node in self.nodes],
|
286
|
+
"edges": [edge.to_json() for edge in self.edges],
|
287
|
+
}
|
288
|
+
|
289
|
+
def bind_to_run(self, *args, **kwargs):
|
290
|
+
data = self._to_graph_json()
|
291
|
+
tmp_path = os.path.join(MEDIA_TMP.name, runid.generate_id() + ".graph.json")
|
292
|
+
data = _numpy_arrays_to_lists(data)
|
293
|
+
with codecs.open(tmp_path, "w", encoding="utf-8") as fp:
|
294
|
+
util.json_dump_safer(data, fp)
|
295
|
+
self._set_file(tmp_path, is_tmp=True, extension=".graph.json")
|
296
|
+
if self.is_bound():
|
297
|
+
return
|
298
|
+
super().bind_to_run(*args, **kwargs)
|
299
|
+
|
300
|
+
@classmethod
|
301
|
+
def get_media_subdir(cls):
|
302
|
+
return os.path.join("media", "graph")
|
303
|
+
|
304
|
+
def to_json(self, run):
|
305
|
+
json_dict = super().to_json(run)
|
306
|
+
json_dict["_type"] = self._log_type
|
307
|
+
return json_dict
|
308
|
+
|
309
|
+
def __getitem__(self, nid):
|
310
|
+
return self.nodes_by_id[nid]
|
311
|
+
|
312
|
+
def pprint(self):
|
313
|
+
for edge in self.edges:
|
314
|
+
pprint.pprint(edge.attributes)
|
315
|
+
for node in self.nodes:
|
316
|
+
pprint.pprint(node.attributes)
|
317
|
+
|
318
|
+
def add_node(self, node=None, **node_kwargs):
|
319
|
+
if node is None:
|
320
|
+
node = Node(**node_kwargs)
|
321
|
+
elif node_kwargs:
|
322
|
+
raise ValueError(
|
323
|
+
f"Only pass one of either node ({node}) or other keyword arguments ({node_kwargs})"
|
324
|
+
)
|
325
|
+
self.nodes.append(node)
|
326
|
+
self.nodes_by_id[node.id] = node
|
327
|
+
|
328
|
+
return node
|
329
|
+
|
330
|
+
def add_edge(self, from_node, to_node):
|
331
|
+
edge = Edge(from_node, to_node)
|
332
|
+
self.edges.append(edge)
|
333
|
+
|
334
|
+
return edge
|
335
|
+
|
336
|
+
@classmethod
|
337
|
+
def from_keras(cls, model):
|
338
|
+
# TODO: his method requires a refactor to work with the keras 3.
|
339
|
+
graph = cls()
|
340
|
+
# Shamelessly copied (then modified) from keras/keras/utils/layer_utils.py
|
341
|
+
sequential_like = cls._is_sequential(model)
|
342
|
+
|
343
|
+
relevant_nodes = None
|
344
|
+
if not sequential_like:
|
345
|
+
relevant_nodes = []
|
346
|
+
for v in model._nodes_by_depth.values():
|
347
|
+
relevant_nodes += v
|
348
|
+
|
349
|
+
layers = model.layers
|
350
|
+
for i in range(len(layers)):
|
351
|
+
node = Node.from_keras(layers[i])
|
352
|
+
if hasattr(layers[i], "_inbound_nodes"):
|
353
|
+
for in_node in layers[i]._inbound_nodes:
|
354
|
+
if relevant_nodes and in_node not in relevant_nodes:
|
355
|
+
# node is not part of the current network
|
356
|
+
continue
|
357
|
+
for in_layer in _nest(in_node.inbound_layers):
|
358
|
+
inbound_keras_node = Node.from_keras(in_layer)
|
359
|
+
|
360
|
+
if inbound_keras_node.id not in graph.nodes_by_id:
|
361
|
+
graph.add_node(inbound_keras_node)
|
362
|
+
inbound_node = graph.nodes_by_id[inbound_keras_node.id]
|
363
|
+
|
364
|
+
graph.add_edge(inbound_node, node)
|
365
|
+
graph.add_node(node)
|
366
|
+
return graph
|
367
|
+
|
368
|
+
@classmethod
|
369
|
+
def _is_sequential(cls, model):
|
370
|
+
sequential_like = True
|
371
|
+
|
372
|
+
if (
|
373
|
+
model.__class__.__name__ != "Sequential"
|
374
|
+
and hasattr(model, "_is_graph_network")
|
375
|
+
and model._is_graph_network
|
376
|
+
):
|
377
|
+
nodes_by_depth = model._nodes_by_depth.values()
|
378
|
+
nodes = []
|
379
|
+
for v in nodes_by_depth:
|
380
|
+
# TensorFlow2 doesn't insure inbound is always a list
|
381
|
+
inbound = v[0].inbound_layers
|
382
|
+
if not hasattr(inbound, "__len__"):
|
383
|
+
inbound = [inbound]
|
384
|
+
if (len(v) > 1) or (len(v) == 1 and len(inbound) > 1):
|
385
|
+
# if the model has multiple nodes
|
386
|
+
# or if the nodes have multiple inbound_layers
|
387
|
+
# the model is no longer sequential
|
388
|
+
sequential_like = False
|
389
|
+
break
|
390
|
+
nodes += v
|
391
|
+
if sequential_like:
|
392
|
+
# search for shared layers
|
393
|
+
for layer in model.layers:
|
394
|
+
flag = False
|
395
|
+
if hasattr(layer, "_inbound_nodes"):
|
396
|
+
for node in layer._inbound_nodes:
|
397
|
+
if node in nodes:
|
398
|
+
if flag:
|
399
|
+
sequential_like = False
|
400
|
+
break
|
401
|
+
else:
|
402
|
+
flag = True
|
403
|
+
if not sequential_like:
|
404
|
+
break
|
405
|
+
return sequential_like
|
File without changes
|
@@ -0,0 +1,295 @@
|
|
1
|
+
import numbers
|
2
|
+
from typing import TYPE_CHECKING, Optional, Type, Union
|
3
|
+
|
4
|
+
import wandb
|
5
|
+
from wandb import util
|
6
|
+
from wandb.util import has_num
|
7
|
+
|
8
|
+
from ..base_types.json_metadata import JSONMetadata
|
9
|
+
|
10
|
+
if TYPE_CHECKING: # pragma: no cover
|
11
|
+
from wandb.sdk.artifacts.artifact import Artifact
|
12
|
+
|
13
|
+
from ...wandb_run import Run as LocalRun
|
14
|
+
|
15
|
+
|
16
|
+
class BoundingBoxes2D(JSONMetadata):
|
17
|
+
"""Format images with 2D bounding box overlays for logging to W&B.
|
18
|
+
|
19
|
+
Arguments:
|
20
|
+
val: (dictionary) A dictionary of the following form:
|
21
|
+
box_data: (list of dictionaries) One dictionary for each bounding box, containing:
|
22
|
+
position: (dictionary) the position and size of the bounding box, in one of two formats
|
23
|
+
Note that boxes need not all use the same format.
|
24
|
+
{"minX", "minY", "maxX", "maxY"}: (dictionary) A set of coordinates defining
|
25
|
+
the upper and lower bounds of the box (the bottom left and top right corners)
|
26
|
+
{"middle", "width", "height"}: (dictionary) A set of coordinates defining the
|
27
|
+
center and dimensions of the box, with "middle" as a list [x, y] for the
|
28
|
+
center point and "width" and "height" as numbers
|
29
|
+
domain: (string) One of two options for the bounding box coordinate domain
|
30
|
+
null: By default, or if no argument is passed, the coordinate domain
|
31
|
+
is assumed to be relative to the original image, expressing this box as a fraction
|
32
|
+
or percentage of the original image. This means all coordinates and dimensions
|
33
|
+
passed into the "position" argument are floating point numbers between 0 and 1.
|
34
|
+
"pixel": (string literal) The coordinate domain is set to the pixel space. This means all
|
35
|
+
coordinates and dimensions passed into "position" are integers within the bounds
|
36
|
+
of the image dimensions.
|
37
|
+
class_id: (integer) The class label id for this box
|
38
|
+
scores: (dictionary of string to number, optional) A mapping of named fields
|
39
|
+
to numerical values (float or int), can be used for filtering boxes in the UI
|
40
|
+
based on a range of values for the corresponding field
|
41
|
+
box_caption: (string, optional) A string to be displayed as the label text above this
|
42
|
+
box in the UI, often composed of the class label, class name, and/or scores
|
43
|
+
|
44
|
+
class_labels: (dictionary, optional) A map of integer class labels to their readable class names
|
45
|
+
|
46
|
+
key: (string)
|
47
|
+
The readable name or id for this set of bounding boxes (e.g. predictions, ground_truth)
|
48
|
+
|
49
|
+
Examples:
|
50
|
+
### Log bounding boxes for a single image
|
51
|
+
<!--yeadoc-test:boundingbox-2d-->
|
52
|
+
```python
|
53
|
+
import numpy as np
|
54
|
+
import wandb
|
55
|
+
|
56
|
+
wandb.init()
|
57
|
+
image = np.random.randint(low=0, high=256, size=(200, 300, 3))
|
58
|
+
|
59
|
+
class_labels = {0: "person", 1: "car", 2: "road", 3: "building"}
|
60
|
+
|
61
|
+
img = wandb.Image(
|
62
|
+
image,
|
63
|
+
boxes={
|
64
|
+
"predictions": {
|
65
|
+
"box_data": [
|
66
|
+
{
|
67
|
+
# one box expressed in the default relative/fractional domain
|
68
|
+
"position": {"minX": 0.1, "maxX": 0.2, "minY": 0.3, "maxY": 0.4},
|
69
|
+
"class_id": 1,
|
70
|
+
"box_caption": class_labels[1],
|
71
|
+
"scores": {"acc": 0.2, "loss": 1.2},
|
72
|
+
},
|
73
|
+
{
|
74
|
+
# another box expressed in the pixel domain
|
75
|
+
"position": {"middle": [150, 20], "width": 68, "height": 112},
|
76
|
+
"domain": "pixel",
|
77
|
+
"class_id": 3,
|
78
|
+
"box_caption": "a building",
|
79
|
+
"scores": {"acc": 0.5, "loss": 0.7},
|
80
|
+
},
|
81
|
+
# Log as many boxes an as needed
|
82
|
+
],
|
83
|
+
"class_labels": class_labels,
|
84
|
+
}
|
85
|
+
},
|
86
|
+
)
|
87
|
+
|
88
|
+
wandb.log({"driving_scene": img})
|
89
|
+
```
|
90
|
+
|
91
|
+
### Log a bounding box overlay to a Table
|
92
|
+
<!--yeadoc-test:bb2d-image-with-labels-->
|
93
|
+
```python
|
94
|
+
import numpy as np
|
95
|
+
import wandb
|
96
|
+
|
97
|
+
wandb.init()
|
98
|
+
image = np.random.randint(low=0, high=256, size=(200, 300, 3))
|
99
|
+
|
100
|
+
class_labels = {0: "person", 1: "car", 2: "road", 3: "building"}
|
101
|
+
|
102
|
+
class_set = wandb.Classes(
|
103
|
+
[
|
104
|
+
{"name": "person", "id": 0},
|
105
|
+
{"name": "car", "id": 1},
|
106
|
+
{"name": "road", "id": 2},
|
107
|
+
{"name": "building", "id": 3},
|
108
|
+
]
|
109
|
+
)
|
110
|
+
|
111
|
+
img = wandb.Image(
|
112
|
+
image,
|
113
|
+
boxes={
|
114
|
+
"predictions": {
|
115
|
+
"box_data": [
|
116
|
+
{
|
117
|
+
# one box expressed in the default relative/fractional domain
|
118
|
+
"position": {"minX": 0.1, "maxX": 0.2, "minY": 0.3, "maxY": 0.4},
|
119
|
+
"class_id": 1,
|
120
|
+
"box_caption": class_labels[1],
|
121
|
+
"scores": {"acc": 0.2, "loss": 1.2},
|
122
|
+
},
|
123
|
+
{
|
124
|
+
# another box expressed in the pixel domain
|
125
|
+
"position": {"middle": [150, 20], "width": 68, "height": 112},
|
126
|
+
"domain": "pixel",
|
127
|
+
"class_id": 3,
|
128
|
+
"box_caption": "a building",
|
129
|
+
"scores": {"acc": 0.5, "loss": 0.7},
|
130
|
+
},
|
131
|
+
# Log as many boxes an as needed
|
132
|
+
],
|
133
|
+
"class_labels": class_labels,
|
134
|
+
}
|
135
|
+
},
|
136
|
+
classes=class_set,
|
137
|
+
)
|
138
|
+
|
139
|
+
table = wandb.Table(columns=["image"])
|
140
|
+
table.add_data(img)
|
141
|
+
wandb.log({"driving_scene": table})
|
142
|
+
```
|
143
|
+
"""
|
144
|
+
|
145
|
+
_log_type = "bounding-boxes"
|
146
|
+
# TODO: when the change is made to have this produce a dict with a _type, define
|
147
|
+
# it here as _log_type, associate it in to_json
|
148
|
+
|
149
|
+
def __init__(self, val: dict, key: str) -> None:
|
150
|
+
"""Initialize a BoundingBoxes object.
|
151
|
+
|
152
|
+
The input dictionary `val` should contain the keys:
|
153
|
+
box_data: a list of dictionaries, each of which describes a bounding box.
|
154
|
+
class_labels: (optional) A map of integer class labels to their readable
|
155
|
+
class names.
|
156
|
+
|
157
|
+
Each bounding box dictionary should contain the following keys:
|
158
|
+
position: (dictionary) the position and size of the bounding box.
|
159
|
+
domain: (string) One of two options for the bounding box coordinate domain.
|
160
|
+
class_id: (integer) The class label id for this box.
|
161
|
+
scores: (dictionary of string to number, optional) A mapping of named fields
|
162
|
+
to numerical values (float or int).
|
163
|
+
box_caption: (optional) The label text, often composed of the class label,
|
164
|
+
class name, and/or scores.
|
165
|
+
|
166
|
+
The position dictionary should be in one of two formats:
|
167
|
+
{"minX", "minY", "maxX", "maxY"}: (dictionary) A set of coordinates defining
|
168
|
+
the upper and lower bounds of the box (the bottom left and top right
|
169
|
+
corners).
|
170
|
+
{"middle", "width", "height"}: (dictionary) A set of coordinates defining
|
171
|
+
the center and dimensions of the box, with "middle" as a list [x, y] for
|
172
|
+
the center point and "width" and "height" as numbers.
|
173
|
+
Note that boxes need not all use the same format.
|
174
|
+
|
175
|
+
Args:
|
176
|
+
val: (dictionary) A dictionary containing the bounding box data.
|
177
|
+
key: (string) The readable name or id for this set of bounding boxes (e.g.
|
178
|
+
predictions, ground_truth)
|
179
|
+
"""
|
180
|
+
super().__init__(val)
|
181
|
+
self._val = val["box_data"]
|
182
|
+
self._key = key
|
183
|
+
# Add default class mapping
|
184
|
+
if "class_labels" not in val:
|
185
|
+
np = util.get_module(
|
186
|
+
"numpy", required="Bounding box support requires numpy"
|
187
|
+
)
|
188
|
+
classes = (
|
189
|
+
np.unique(list(box["class_id"] for box in val["box_data"]))
|
190
|
+
.astype(np.int32)
|
191
|
+
.tolist()
|
192
|
+
)
|
193
|
+
class_labels = {c: "class_" + str(c) for c in classes}
|
194
|
+
self._class_labels = class_labels
|
195
|
+
else:
|
196
|
+
self._class_labels = val["class_labels"]
|
197
|
+
|
198
|
+
def bind_to_run(
|
199
|
+
self,
|
200
|
+
run: "LocalRun",
|
201
|
+
key: Union[int, str],
|
202
|
+
step: Union[int, str],
|
203
|
+
id_: Optional[Union[int, str]] = None,
|
204
|
+
ignore_copy_err: Optional[bool] = None,
|
205
|
+
) -> None:
|
206
|
+
# bind_to_run key argument is the Image parent key
|
207
|
+
# the self._key value is the mask's sub key
|
208
|
+
super().bind_to_run(run, key, step, id_=id_, ignore_copy_err=ignore_copy_err)
|
209
|
+
run._add_singleton(
|
210
|
+
"bounding_box/class_labels",
|
211
|
+
str(key) + "_wandb_delimeter_" + self._key,
|
212
|
+
self._class_labels,
|
213
|
+
)
|
214
|
+
|
215
|
+
@classmethod
|
216
|
+
def type_name(cls) -> str:
|
217
|
+
return "boxes2D"
|
218
|
+
|
219
|
+
def validate(self, val: dict) -> bool:
|
220
|
+
# Optional argument
|
221
|
+
if "class_labels" in val:
|
222
|
+
for k, v in list(val["class_labels"].items()):
|
223
|
+
if (not isinstance(k, numbers.Number)) or (not isinstance(v, str)):
|
224
|
+
raise TypeError(
|
225
|
+
"Class labels must be a dictionary of numbers to string"
|
226
|
+
)
|
227
|
+
|
228
|
+
boxes = val["box_data"]
|
229
|
+
if not isinstance(boxes, list):
|
230
|
+
raise TypeError("Boxes must be a list")
|
231
|
+
|
232
|
+
for box in boxes:
|
233
|
+
# Required arguments
|
234
|
+
error_str = (
|
235
|
+
"Each box must contain a position with: middle, width, and height or \
|
236
|
+
\nminX, maxX, minY, maxY."
|
237
|
+
)
|
238
|
+
if "position" not in box:
|
239
|
+
raise TypeError(error_str)
|
240
|
+
else:
|
241
|
+
valid = False
|
242
|
+
if (
|
243
|
+
"middle" in box["position"]
|
244
|
+
and len(box["position"]["middle"]) == 2
|
245
|
+
and has_num(box["position"], "width")
|
246
|
+
and has_num(box["position"], "height")
|
247
|
+
):
|
248
|
+
valid = True
|
249
|
+
elif (
|
250
|
+
has_num(box["position"], "minX")
|
251
|
+
and has_num(box["position"], "maxX")
|
252
|
+
and has_num(box["position"], "minY")
|
253
|
+
and has_num(box["position"], "maxY")
|
254
|
+
):
|
255
|
+
valid = True
|
256
|
+
|
257
|
+
if not valid:
|
258
|
+
raise TypeError(error_str)
|
259
|
+
|
260
|
+
# Optional arguments
|
261
|
+
if ("scores" in box) and not isinstance(box["scores"], dict):
|
262
|
+
raise TypeError("Box scores must be a dictionary")
|
263
|
+
elif "scores" in box:
|
264
|
+
for k, v in list(box["scores"].items()):
|
265
|
+
if not isinstance(k, str):
|
266
|
+
raise TypeError("A score key must be a string")
|
267
|
+
if not isinstance(v, numbers.Number):
|
268
|
+
raise TypeError("A score value must be a number")
|
269
|
+
|
270
|
+
if ("class_id" in box) and not isinstance(box["class_id"], int):
|
271
|
+
raise TypeError("A box's class_id must be an integer")
|
272
|
+
|
273
|
+
# Optional
|
274
|
+
if ("box_caption" in box) and not isinstance(box["box_caption"], str):
|
275
|
+
raise TypeError("A box's caption must be a string")
|
276
|
+
return True
|
277
|
+
|
278
|
+
def to_json(self, run_or_artifact: Union["LocalRun", "Artifact"]) -> dict:
|
279
|
+
from wandb.sdk.wandb_run import Run
|
280
|
+
|
281
|
+
if isinstance(run_or_artifact, Run):
|
282
|
+
return super().to_json(run_or_artifact)
|
283
|
+
elif isinstance(run_or_artifact, wandb.Artifact):
|
284
|
+
# TODO (tim): I would like to log out a proper dictionary representing this object, but don't
|
285
|
+
# want to mess with the visualizations that are currently available in the UI. This really should output
|
286
|
+
# an object with a _type key. Will need to push this change to the UI first to ensure backwards compat
|
287
|
+
return self._val
|
288
|
+
else:
|
289
|
+
raise ValueError("to_json accepts wandb_run.Run or wandb.Artifact")
|
290
|
+
|
291
|
+
@classmethod
|
292
|
+
def from_json(
|
293
|
+
cls: Type["BoundingBoxes2D"], json_obj: dict, source_artifact: "Artifact"
|
294
|
+
) -> "BoundingBoxes2D":
|
295
|
+
return cls({"box_data": json_obj}, "")
|