wandb 0.16.5__py3-none-any.whl → 0.17.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- package_readme.md +95 -0
- wandb/__init__.py +2 -3
- wandb/agents/pyagent.py +0 -1
- wandb/analytics/sentry.py +2 -1
- wandb/apis/importers/internals/internal.py +0 -1
- wandb/apis/importers/internals/protocols.py +30 -56
- wandb/apis/importers/mlflow.py +13 -26
- wandb/apis/importers/wandb.py +8 -14
- wandb/apis/internal.py +0 -3
- wandb/apis/public/api.py +55 -3
- wandb/apis/public/artifacts.py +1 -0
- wandb/apis/public/files.py +1 -0
- wandb/apis/public/history.py +1 -0
- wandb/apis/public/jobs.py +17 -4
- wandb/apis/public/projects.py +1 -0
- wandb/apis/public/reports.py +1 -0
- wandb/apis/public/runs.py +15 -17
- wandb/apis/public/sweeps.py +1 -0
- wandb/apis/public/teams.py +1 -0
- wandb/apis/public/users.py +1 -0
- wandb/apis/reports/v1/_blocks.py +3 -7
- wandb/apis/reports/v2/gql.py +1 -0
- wandb/apis/reports/v2/interface.py +3 -4
- wandb/apis/reports/v2/internal.py +5 -8
- wandb/cli/cli.py +95 -22
- wandb/data_types.py +9 -6
- wandb/docker/__init__.py +1 -1
- wandb/env.py +38 -8
- wandb/errors/__init__.py +5 -0
- wandb/errors/term.py +10 -2
- wandb/filesync/step_checksum.py +1 -4
- wandb/filesync/step_prepare.py +4 -24
- wandb/filesync/step_upload.py +4 -106
- wandb/filesync/upload_job.py +0 -76
- wandb/integration/catboost/catboost.py +1 -1
- wandb/integration/fastai/__init__.py +1 -0
- wandb/integration/huggingface/resolver.py +2 -2
- wandb/integration/keras/__init__.py +1 -0
- wandb/integration/keras/callbacks/metrics_logger.py +1 -1
- wandb/integration/keras/keras.py +7 -7
- wandb/integration/langchain/wandb_tracer.py +1 -0
- wandb/integration/lightning/fabric/logger.py +1 -3
- wandb/integration/metaflow/metaflow.py +41 -6
- wandb/integration/openai/fine_tuning.py +77 -40
- wandb/integration/prodigy/prodigy.py +1 -1
- wandb/old/summary.py +1 -1
- wandb/plot/confusion_matrix.py +1 -1
- wandb/plot/pr_curve.py +2 -1
- wandb/plot/roc_curve.py +2 -1
- wandb/{plots → plot}/utils.py +13 -25
- wandb/proto/v3/wandb_internal_pb2.py +364 -332
- wandb/proto/v3/wandb_settings_pb2.py +2 -2
- wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
- wandb/proto/v4/wandb_internal_pb2.py +322 -316
- wandb/proto/v4/wandb_settings_pb2.py +2 -2
- wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
- wandb/proto/wandb_deprecated.py +7 -1
- wandb/proto/wandb_internal_codegen.py +3 -29
- wandb/sdk/artifacts/artifact.py +51 -20
- wandb/sdk/artifacts/artifact_download_logger.py +1 -0
- wandb/sdk/artifacts/artifact_file_cache.py +18 -4
- wandb/sdk/artifacts/artifact_instance_cache.py +1 -0
- wandb/sdk/artifacts/artifact_manifest.py +1 -0
- wandb/sdk/artifacts/artifact_manifest_entry.py +7 -3
- wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +1 -0
- wandb/sdk/artifacts/artifact_saver.py +18 -27
- wandb/sdk/artifacts/artifact_state.py +1 -0
- wandb/sdk/artifacts/artifact_ttl.py +1 -0
- wandb/sdk/artifacts/exceptions.py +1 -0
- wandb/sdk/artifacts/storage_handlers/azure_handler.py +1 -0
- wandb/sdk/artifacts/storage_handlers/gcs_handler.py +13 -18
- wandb/sdk/artifacts/storage_handlers/http_handler.py +1 -0
- wandb/sdk/artifacts/storage_handlers/local_file_handler.py +1 -0
- wandb/sdk/artifacts/storage_handlers/multi_handler.py +1 -0
- wandb/sdk/artifacts/storage_handlers/s3_handler.py +5 -3
- wandb/sdk/artifacts/storage_handlers/tracking_handler.py +1 -0
- wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +1 -0
- wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -0
- wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +3 -42
- wandb/sdk/artifacts/storage_policy.py +2 -12
- wandb/sdk/data_types/_dtypes.py +8 -8
- wandb/sdk/data_types/base_types/media.py +3 -6
- wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +3 -1
- wandb/sdk/data_types/image.py +1 -1
- wandb/sdk/data_types/video.py +1 -1
- wandb/sdk/integration_utils/auto_logging.py +5 -6
- wandb/sdk/integration_utils/data_logging.py +10 -6
- wandb/sdk/interface/interface.py +86 -38
- wandb/sdk/interface/interface_shared.py +7 -13
- wandb/sdk/internal/datastore.py +1 -1
- wandb/sdk/internal/file_pusher.py +2 -5
- wandb/sdk/internal/file_stream.py +5 -18
- wandb/sdk/internal/handler.py +18 -2
- wandb/sdk/internal/internal.py +0 -1
- wandb/sdk/internal/internal_api.py +1 -129
- wandb/sdk/internal/internal_util.py +0 -1
- wandb/sdk/internal/job_builder.py +159 -45
- wandb/sdk/internal/profiler.py +1 -0
- wandb/sdk/internal/progress.py +0 -28
- wandb/sdk/internal/run.py +1 -0
- wandb/sdk/internal/sender.py +1 -2
- wandb/sdk/internal/system/assets/gpu_amd.py +44 -44
- wandb/sdk/internal/system/assets/gpu_apple.py +56 -11
- wandb/sdk/internal/system/assets/interfaces.py +6 -8
- wandb/sdk/internal/system/assets/open_metrics.py +2 -2
- wandb/sdk/internal/system/assets/trainium.py +1 -3
- wandb/sdk/launch/__init__.py +9 -1
- wandb/sdk/launch/_launch.py +9 -24
- wandb/sdk/launch/_launch_add.py +1 -3
- wandb/sdk/launch/_project_spec.py +188 -241
- wandb/sdk/launch/agent/agent.py +115 -48
- wandb/sdk/launch/agent/config.py +80 -14
- wandb/sdk/launch/builder/abstract.py +69 -1
- wandb/sdk/launch/builder/build.py +156 -555
- wandb/sdk/launch/builder/context_manager.py +235 -0
- wandb/sdk/launch/builder/docker_builder.py +8 -23
- wandb/sdk/launch/builder/kaniko_builder.py +161 -159
- wandb/sdk/launch/builder/noop.py +1 -0
- wandb/sdk/launch/builder/templates/dockerfile.py +92 -0
- wandb/sdk/launch/create_job.py +68 -63
- wandb/sdk/launch/environment/abstract.py +1 -0
- wandb/sdk/launch/environment/gcp_environment.py +1 -0
- wandb/sdk/launch/environment/local_environment.py +1 -0
- wandb/sdk/launch/inputs/files.py +148 -0
- wandb/sdk/launch/inputs/internal.py +217 -0
- wandb/sdk/launch/inputs/manage.py +95 -0
- wandb/sdk/launch/loader.py +1 -0
- wandb/sdk/launch/registry/abstract.py +1 -0
- wandb/sdk/launch/registry/azure_container_registry.py +1 -0
- wandb/sdk/launch/registry/elastic_container_registry.py +1 -0
- wandb/sdk/launch/registry/google_artifact_registry.py +2 -1
- wandb/sdk/launch/registry/local_registry.py +1 -0
- wandb/sdk/launch/runner/abstract.py +1 -0
- wandb/sdk/launch/runner/kubernetes_monitor.py +4 -1
- wandb/sdk/launch/runner/kubernetes_runner.py +9 -10
- wandb/sdk/launch/runner/local_container.py +2 -3
- wandb/sdk/launch/runner/local_process.py +8 -29
- wandb/sdk/launch/runner/sagemaker_runner.py +21 -20
- wandb/sdk/launch/runner/vertex_runner.py +8 -7
- wandb/sdk/launch/sweeps/scheduler.py +7 -4
- wandb/sdk/launch/sweeps/scheduler_sweep.py +2 -1
- wandb/sdk/launch/sweeps/utils.py +3 -3
- wandb/sdk/launch/utils.py +33 -140
- wandb/sdk/lib/_settings_toposort_generated.py +1 -5
- wandb/sdk/lib/fsm.py +8 -12
- wandb/sdk/lib/gitlib.py +4 -4
- wandb/sdk/lib/import_hooks.py +1 -1
- wandb/sdk/lib/lazyloader.py +0 -1
- wandb/sdk/lib/proto_util.py +23 -2
- wandb/sdk/lib/redirect.py +19 -14
- wandb/sdk/lib/retry.py +3 -2
- wandb/sdk/lib/run_moment.py +7 -1
- wandb/sdk/lib/tracelog.py +1 -1
- wandb/sdk/service/service.py +19 -16
- wandb/sdk/verify/verify.py +2 -1
- wandb/sdk/wandb_init.py +16 -63
- wandb/sdk/wandb_manager.py +2 -2
- wandb/sdk/wandb_require.py +5 -0
- wandb/sdk/wandb_run.py +164 -90
- wandb/sdk/wandb_settings.py +2 -48
- wandb/sdk/wandb_setup.py +1 -1
- wandb/sklearn/__init__.py +1 -0
- wandb/sklearn/plot/__init__.py +1 -0
- wandb/sklearn/plot/classifier.py +11 -12
- wandb/sklearn/plot/clusterer.py +2 -1
- wandb/sklearn/plot/regressor.py +1 -0
- wandb/sklearn/plot/shared.py +1 -0
- wandb/sklearn/utils.py +1 -0
- wandb/testing/relay.py +4 -4
- wandb/trigger.py +1 -0
- wandb/util.py +67 -54
- wandb/wandb_controller.py +2 -3
- wandb/wandb_torch.py +1 -2
- {wandb-0.16.5.dist-info → wandb-0.17.0.dist-info}/METADATA +67 -70
- {wandb-0.16.5.dist-info → wandb-0.17.0.dist-info}/RECORD +178 -188
- {wandb-0.16.5.dist-info → wandb-0.17.0.dist-info}/WHEEL +1 -2
- wandb/bin/apple_gpu_stats +0 -0
- wandb/catboost/__init__.py +0 -9
- wandb/fastai/__init__.py +0 -9
- wandb/keras/__init__.py +0 -18
- wandb/lightgbm/__init__.py +0 -9
- wandb/plots/__init__.py +0 -6
- wandb/plots/explain_text.py +0 -36
- wandb/plots/heatmap.py +0 -81
- wandb/plots/named_entity.py +0 -43
- wandb/plots/part_of_speech.py +0 -50
- wandb/plots/plot_definitions.py +0 -768
- wandb/plots/precision_recall.py +0 -121
- wandb/plots/roc.py +0 -103
- wandb/sacred/__init__.py +0 -3
- wandb/xgboost/__init__.py +0 -9
- wandb-0.16.5.dist-info/top_level.txt +0 -1
- {wandb-0.16.5.dist-info → wandb-0.17.0.dist-info}/entry_points.txt +0 -0
- {wandb-0.16.5.dist-info → wandb-0.17.0.dist-info/licenses}/LICENSE +0 -0
wandb/plots/precision_recall.py
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
import wandb
|
2
|
-
from wandb import util
|
3
|
-
from wandb.plots.utils import (
|
4
|
-
deprecation_notice,
|
5
|
-
encode_labels,
|
6
|
-
test_missing,
|
7
|
-
test_types,
|
8
|
-
)
|
9
|
-
|
10
|
-
chart_limit = wandb.Table.MAX_ROWS
|
11
|
-
|
12
|
-
|
13
|
-
def precision_recall(
|
14
|
-
y_true=None, y_probas=None, labels=None, plot_micro=True, classes_to_plot=None
|
15
|
-
):
|
16
|
-
"""
|
17
|
-
Computes the tradeoff between precision and recall for different thresholds.
|
18
|
-
A high area under the curve represents both high recall and high precision,
|
19
|
-
where high precision relates to a low false positive rate, and high recall
|
20
|
-
relates to a low false negative rate. High scores for both show that the
|
21
|
-
classifier is returning accurate results (high precision), as well as
|
22
|
-
returning a majority of all positive results (high recall).
|
23
|
-
PR curve is useful when the classes are very imbalanced.
|
24
|
-
|
25
|
-
Arguments:
|
26
|
-
y_true (arr): Test set labels.
|
27
|
-
y_probas (arr): Test set predicted probabilities.
|
28
|
-
labels (list): Named labels for target varible (y). Makes plots easier to
|
29
|
-
read by replacing target values with corresponding index.
|
30
|
-
For example labels= ['dog', 'cat', 'owl'] all 0s are
|
31
|
-
replaced by 'dog', 1s by 'cat'.
|
32
|
-
|
33
|
-
Returns:
|
34
|
-
Nothing. To see plots, go to your W&B run page then expand the 'media' tab
|
35
|
-
under 'auto visualizations'.
|
36
|
-
|
37
|
-
Example:
|
38
|
-
wandb.log({'pr': wandb.plots.precision_recall(y_true, y_probas, labels)})
|
39
|
-
"""
|
40
|
-
deprecation_notice()
|
41
|
-
|
42
|
-
np = util.get_module(
|
43
|
-
"numpy",
|
44
|
-
required="roc requires the numpy library, install with `pip install numpy`",
|
45
|
-
)
|
46
|
-
preprocessing = util.get_module(
|
47
|
-
"sklearn.preprocessing",
|
48
|
-
"roc requires the scikit preprocessing submodule, install with `pip install scikit-learn`",
|
49
|
-
)
|
50
|
-
metrics = util.get_module(
|
51
|
-
"sklearn.metrics",
|
52
|
-
"roc requires the scikit metrics submodule, install with `pip install scikit-learn`",
|
53
|
-
)
|
54
|
-
|
55
|
-
y_true = np.array(y_true)
|
56
|
-
y_probas = np.array(y_probas)
|
57
|
-
|
58
|
-
if test_missing(y_true=y_true, y_probas=y_probas) and test_types(
|
59
|
-
y_true=y_true, y_probas=y_probas
|
60
|
-
):
|
61
|
-
classes = np.unique(y_true)
|
62
|
-
probas = y_probas
|
63
|
-
|
64
|
-
if classes_to_plot is None:
|
65
|
-
classes_to_plot = classes
|
66
|
-
|
67
|
-
binarized_y_true = preprocessing.label_binarize(y_true, classes=classes)
|
68
|
-
if len(classes) == 2:
|
69
|
-
binarized_y_true = np.hstack((1 - binarized_y_true, binarized_y_true))
|
70
|
-
|
71
|
-
pr_curves = {}
|
72
|
-
indices_to_plot = np.in1d(classes, classes_to_plot)
|
73
|
-
for i, to_plot in enumerate(indices_to_plot):
|
74
|
-
if to_plot:
|
75
|
-
average_precision = metrics.average_precision_score(
|
76
|
-
binarized_y_true[:, i], probas[:, i]
|
77
|
-
)
|
78
|
-
precision, recall, _ = metrics.precision_recall_curve(
|
79
|
-
y_true, probas[:, i], pos_label=classes[i]
|
80
|
-
)
|
81
|
-
|
82
|
-
samples = 20
|
83
|
-
sample_precision = []
|
84
|
-
sample_recall = []
|
85
|
-
for k in range(samples):
|
86
|
-
sample_precision.append(
|
87
|
-
precision[int(len(precision) * k / samples)]
|
88
|
-
)
|
89
|
-
sample_recall.append(recall[int(len(recall) * k / samples)])
|
90
|
-
|
91
|
-
pr_curves[classes[i]] = (sample_precision, sample_recall)
|
92
|
-
|
93
|
-
def pr_table(pr_curves):
|
94
|
-
data = []
|
95
|
-
count = 0
|
96
|
-
for i, class_name in enumerate(pr_curves.keys()):
|
97
|
-
precision, recall = pr_curves[class_name]
|
98
|
-
for p, r in zip(precision, recall):
|
99
|
-
# if class_names are ints and labels are set
|
100
|
-
if labels is not None and (
|
101
|
-
isinstance(class_name, int)
|
102
|
-
or isinstance(class_name, np.integer)
|
103
|
-
):
|
104
|
-
class_name = labels[class_name]
|
105
|
-
# if class_names are ints and labels are not set
|
106
|
-
# or, if class_names have something other than ints
|
107
|
-
# (string, float, date) - user class_names
|
108
|
-
data.append([class_name, round(p, 3), round(r, 3)])
|
109
|
-
count += 1
|
110
|
-
if count >= chart_limit:
|
111
|
-
wandb.termwarn(
|
112
|
-
"wandb uses only the first %d datapoints to create the plots."
|
113
|
-
% wandb.Table.MAX_ROWS
|
114
|
-
)
|
115
|
-
break
|
116
|
-
return wandb.visualize(
|
117
|
-
"wandb/pr_curve/v1",
|
118
|
-
wandb.Table(columns=["class", "precision", "recall"], data=data),
|
119
|
-
)
|
120
|
-
|
121
|
-
return pr_table(pr_curves)
|
wandb/plots/roc.py
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
import wandb
|
2
|
-
from wandb import util
|
3
|
-
from wandb.plots.utils import (
|
4
|
-
deprecation_notice,
|
5
|
-
encode_labels,
|
6
|
-
test_missing,
|
7
|
-
test_types,
|
8
|
-
)
|
9
|
-
|
10
|
-
chart_limit = wandb.Table.MAX_ROWS
|
11
|
-
|
12
|
-
|
13
|
-
def roc(
|
14
|
-
y_true=None,
|
15
|
-
y_probas=None,
|
16
|
-
labels=None,
|
17
|
-
plot_micro=True,
|
18
|
-
plot_macro=True,
|
19
|
-
classes_to_plot=None,
|
20
|
-
):
|
21
|
-
"""
|
22
|
-
Calculates receiver operating characteristic scores and visualizes them as the
|
23
|
-
ROC curve.
|
24
|
-
|
25
|
-
Arguments:
|
26
|
-
y_true (arr): Test set labels.
|
27
|
-
y_probas (arr): Test set predicted probabilities.
|
28
|
-
labels (list): Named labels for target varible (y). Makes plots easier to
|
29
|
-
read by replacing target values with corresponding index.
|
30
|
-
For example labels= ['dog', 'cat', 'owl'] all 0s are
|
31
|
-
replaced by 'dog', 1s by 'cat'.
|
32
|
-
|
33
|
-
Returns:
|
34
|
-
Nothing. To see plots, go to your W&B run page then expand the 'media' tab
|
35
|
-
under 'auto visualizations'.
|
36
|
-
|
37
|
-
Example:
|
38
|
-
wandb.log({'roc': wandb.plots.ROC(y_true, y_probas, labels)})
|
39
|
-
"""
|
40
|
-
deprecation_notice()
|
41
|
-
|
42
|
-
np = util.get_module(
|
43
|
-
"numpy",
|
44
|
-
required="roc requires the numpy library, install with `pip install numpy`",
|
45
|
-
)
|
46
|
-
sklearn = util.get_module(
|
47
|
-
"sklearn",
|
48
|
-
required="roc requires the scikit library, install with `pip install scikit-learn`",
|
49
|
-
)
|
50
|
-
from sklearn.metrics import auc, roc_curve
|
51
|
-
|
52
|
-
if test_missing(y_true=y_true, y_probas=y_probas) and test_types(
|
53
|
-
y_true=y_true, y_probas=y_probas
|
54
|
-
):
|
55
|
-
y_true = np.array(y_true)
|
56
|
-
y_probas = np.array(y_probas)
|
57
|
-
classes = np.unique(y_true)
|
58
|
-
probas = y_probas
|
59
|
-
|
60
|
-
if classes_to_plot is None:
|
61
|
-
classes_to_plot = classes
|
62
|
-
|
63
|
-
fpr_dict = dict()
|
64
|
-
tpr_dict = dict()
|
65
|
-
|
66
|
-
indices_to_plot = np.in1d(classes, classes_to_plot)
|
67
|
-
|
68
|
-
def roc_table(fpr_dict, tpr_dict, classes, indices_to_plot):
|
69
|
-
data = []
|
70
|
-
count = 0
|
71
|
-
|
72
|
-
for i, to_plot in enumerate(indices_to_plot):
|
73
|
-
fpr_dict[i], tpr_dict[i], _ = roc_curve(
|
74
|
-
y_true, probas[:, i], pos_label=classes[i]
|
75
|
-
)
|
76
|
-
if to_plot:
|
77
|
-
roc_auc = auc(fpr_dict[i], tpr_dict[i])
|
78
|
-
for j in range(len(fpr_dict[i])):
|
79
|
-
if labels is not None and (
|
80
|
-
isinstance(classes[i], int)
|
81
|
-
or isinstance(classes[0], np.integer)
|
82
|
-
):
|
83
|
-
class_dict = labels[classes[i]]
|
84
|
-
else:
|
85
|
-
class_dict = classes[i]
|
86
|
-
fpr = [
|
87
|
-
class_dict,
|
88
|
-
round(fpr_dict[i][j], 3),
|
89
|
-
round(tpr_dict[i][j], 3),
|
90
|
-
]
|
91
|
-
data.append(fpr)
|
92
|
-
count += 1
|
93
|
-
if count >= chart_limit:
|
94
|
-
wandb.termwarn(
|
95
|
-
"wandb uses only the first %d datapoints to create the plots."
|
96
|
-
% wandb.Table.MAX_ROWS
|
97
|
-
)
|
98
|
-
break
|
99
|
-
return wandb.visualize(
|
100
|
-
"wandb/roc/v1", wandb.Table(columns=["class", "fpr", "tpr"], data=data)
|
101
|
-
)
|
102
|
-
|
103
|
-
return roc_table(fpr_dict, tpr_dict, classes, indices_to_plot)
|
wandb/sacred/__init__.py
DELETED
wandb/xgboost/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
wandb
|
File without changes
|
File without changes
|