This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
Data Types
Core data types used in the W&B Query Expression Language
1 - Artifact
W&B artifact for versioning datasets, models, and other files.
const artifact: Artifact = {
id: "artifact_abc123",
name: "model-weights",
type: artifactType,
description: "Trained model weights",
aliases: ["latest", "production"],
createdAt: new Date("2024-01-15")
};
Property |
Type |
Description |
id |
string |
Artifact ID |
name |
string |
Artifact name |
type |
ArtifactType |
Artifact type |
description |
string |
Optional. Artifact description |
aliases |
string[] |
Optional. List of aliases |
createdAt |
Date |
Creation timestamp |
2 - ArtifactType
Artifact type definition.
const artifactType: ArtifactType = {
name: "model"
};
Property |
Type |
Description |
name |
string |
Type name |
3 - ArtifactVersion
A specific version of a W&B artifact.
const artifactVersion: ArtifactVersion = {
id: "version_xyz789",
version: "v3",
versionIndex: 3,
aliases: ["latest", "production"],
createdAt: new Date("2024-01-15"),
metadata: {
accuracy: 0.95,
model_type: "transformer"
}
};
Property |
Type |
Description |
id |
string |
Version ID |
version |
string |
Version string (e.g., “v3”) |
versionIndex |
number |
Version index number |
aliases |
string[] |
Optional. List of aliases |
createdAt |
Date |
Creation timestamp |
metadata |
object |
Optional. Version metadata |
4 - ConfigDict
Configuration dictionary for W&B runs. Stores hyperparameters, settings, and metadata.
// Typical ML configuration:
const config: ConfigDict = {
// Training hyperparameters
learning_rate: 0.001,
batch_size: 32,
epochs: 100,
optimizer: "adam",
// Model architecture
model_name: "resnet50",
num_layers: 50,
dropout_rate: 0.2,
hidden_dims: [512, 256, 128],
// Data settings
dataset: "imagenet",
augmentation: true,
train_split: 0.8,
// System settings
device: "cuda",
num_workers: 4,
seed: 42
};
Value Types
Basic Types
string
: Text values like model names, optimizers, datasets
number
: Numeric values including integers, floats, and scientific notation
boolean
: True/false flags
null
: Null values for optional settings
Complex Types
Array
: Lists of any allowed type (e.g., [512, 256, 128]
)
Object
: Nested configuration groups with string keys
Special W&B Types (automatically handled when logging)
- W&B Tables: Appear as reference objects with table metadata (columns, rows, path)
- W&B Artifacts: Appear as reference objects with version and ID information
// What you see after logging a W&B Table to config:
const config: ConfigDict = {
// ... your normal config ...
// This appears automatically when you log wandb.Table() to config:
"evaluation_results": {
"_type": "table-file",
"ncols": 5,
"nrows": 100,
"path": "media/table/eval_results_2_abc123.table.json"
}
};
// What you see after referencing an artifact in config:
const config: ConfigDict = {
// ... your normal config ...
// This appears when you use an artifact:
"model_artifact": {
"_type": "artifactVersion",
"id": "QXJ0aWZhY3Q6MTIzNDU2",
"version": "v3",
"path": "model-weights:v3"
}
};
Common Patterns
// Nested configuration groups
const config: ConfigDict = {
optimizer: {
type: "adam",
betas: [0.9, 0.999],
weight_decay: 0.0001
},
scheduler: {
type: "cosine",
warmup_steps: 1000
}
};
// Environment and metadata
const config: ConfigDict = {
experiment_name: "baseline_v2",
git_commit: "abc123def",
python_version: "3.9.7",
cuda_version: "11.8"
};
Constraints
- Keys must be strings
- Values must be JSON-serializable
- Keys starting with
_wandb
are reserved
- No functions, undefined, or symbols allowed
5 - Entity
Represents a W&B entity (team or individual user).
const entity: Entity = {
id: "entity_abc123",
name: "my-team",
isTeam: true
};
Property |
Type |
Description |
id |
string |
Entity ID |
name |
string |
Entity name |
isTeam |
boolean |
Whether this is a team or individual user |
6 - Project
W&B project containing runs, artifacts, and reports.
const project: Project = {
name: "my-awesome-project",
entity: entity,
createdAt: new Date("2023-01-01"),
updatedAt: new Date("2024-01-20")
};
Property |
Type |
Description |
name |
string |
Project name |
entity |
Entity |
Owning entity |
createdAt |
Date |
Creation timestamp |
updatedAt |
Date |
Last update timestamp |
7 - Run
A training or evaluation run logged to W&B.
const run: Run = {
id: "run_abc123",
name: "sunny-dawn-42",
state: "finished",
config: {
learning_rate: 0.001,
batch_size: 32,
epochs: 10
},
summaryMetrics: {
loss: 0.023,
accuracy: 0.95,
val_accuracy: 0.93
},
createdAt: new Date("2024-01-15T10:30:00Z"),
updatedAt: new Date("2024-01-15T14:45:00Z")
};
Property |
Type |
Description |
id |
string |
Run ID |
name |
string |
Run name |
state |
string |
Run state (e.g., “running”, “finished”, “failed”) |
config |
ConfigDict |
Optional. Run configuration |
summaryMetrics |
SummaryDict |
Optional. Summary metrics |
createdAt |
Date |
Creation timestamp |
updatedAt |
Date |
Last update timestamp |
8 - SummaryDict
Summary dictionary for W&B runs. Stores final metrics, best values, and aggregated results.
// Typical training summary:
const summary: SummaryDict = {
// Final metrics
final_loss: 0.0234,
final_accuracy: 0.9523,
// Best values during training
best_val_loss: 0.0198,
best_val_accuracy: 0.9612,
best_epoch: 87,
// Training statistics
total_train_time: 3600.5, // seconds
total_steps: 50000,
early_stopped: false,
// Test set results
test_accuracy: 0.9487,
test_f1_score: 0.9465
};
Value Types
Basic Types
string
: Text summaries, model paths, status messages
number
: Metrics, scores, counts, durations
boolean
: Binary flags like convergence status
null
: For optional metrics that weren’t computed
Complex Types
Array
: Lists like per-class scores (e.g., [0.92, 0.94, 0.96]
)
Object
: Grouped metrics with string keys
Special W&B Types (automatically handled when logging)
- W&B Histograms: Appear as objects with bins and values arrays
- W&B Tables: Appear as reference objects with table metadata (columns, rows, path)
- W&B Artifacts: Appear as reference objects with version and ID information
// What you see after logging W&B special types to summary:
const summary: SummaryDict = {
// ... your normal metrics ...
// This appears when you log wandb.Histogram():
"weight_distribution": {
"_type": "histogram",
"bins": [0, 0.1, 0.2, 0.3, 0.4, 0.5],
"values": [10, 25, 45, 30, 15, 5]
},
// This appears when you log wandb.Table():
"predictions_table": {
"_type": "table-file",
"ncols": 4,
"nrows": 1000,
"path": "media/table/predictions_3_def456.table.json"
},
// This appears when you reference an artifact:
"best_model": {
"_type": "artifactVersion",
"id": "QXJ0aWZhY3Q6OTg3NjU0",
"version": "v12",
"path": "model-checkpoint:v12"
}
};
Common Patterns
// Grouped metrics by dataset split
const summary: SummaryDict = {
train: {
loss: 0.023,
accuracy: 0.975,
samples_seen: 50000
},
validation: {
loss: 0.045,
accuracy: 0.948,
samples_seen: 10000
},
test: {
loss: 0.041,
accuracy: 0.951,
samples_seen: 10000
}
};
// Multi-class classification results
const summary: SummaryDict = {
accuracy: 0.92,
macro_f1: 0.91,
per_class_precision: [0.95, 0.89, 0.92, 0.90],
per_class_recall: [0.93, 0.91, 0.90, 0.92],
confusion_matrix_logged: true // Actual matrix logged as W&B Table
};
// Model information
const summary: SummaryDict = {
total_parameters: 125_000_000,
trainable_parameters: 124_500_000,
model_size_mb: 476.8,
inference_time_ms: 23.4
};
Constraints
- Keys must be strings
- Values must be JSON-serializable
- Keys starting with
_wandb
are reserved
- Special: Supports NaN for missing/invalid metrics
- No functions, undefined, or symbols allowed
9 - Table
W&B Table for structured data logging and visualization.
const table: Table = {
columns: ["epoch", "loss", "accuracy"],
data: [
[1, 0.5, 0.75],
[2, 0.3, 0.85],
[3, 0.2, 0.90]
]
};
Property |
Type |
Description |
columns |
string[] |
Column names |
data |
any[][] |
Table data rows |
10 - User
Represents a W&B user.
const user: User = {
id: "user_123",
username: "john_doe",
name: "John Doe",
email: "john@example.com"
};
Property |
Type |
Description |
id |
string |
User ID |
username |
string |
Username |
name |
string |
Optional. User’s full name |
email |
string |
Optional. User email |