Utilities
autogenerate_seed()
Automatically generate a random seed for machine-learning experiments.
fetch_wandb_artifact(artifact_address, artifact_type)
Utility function for fetching a Weights & Biases artifact irrespective of whether a run has been initialized or not.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
artifact_address |
str
|
A human-readable name for the artifact, which is how you can
identify the artifact in the UI or reference it in
|
required |
artifact_type |
str
|
The type of the artifact, which is used to organize and differentiate artifacts. Common typesCinclude dataset or model, but you can use any string containing letters, numbers, underscores, hyphens, and dots. |
required |
Returns:
Type | Description |
---|---|
FilePathStr
|
The path to the downloaded contents. |
Source code in wandb_addons/utils.py
flatten_nested_dictionaries(d, parent_key='', sep='/')
A recursive function for flattening nested dictionaries.
Reference:
Answer to
[**Flatten nested dictionaries, compressing keys**](https://stackoverflow.com/q/6027558)
on StackOverflow: [stackoverflow.com/a/6027615](https://stackoverflow.com/a/6027615)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d |
Dict
|
The input nested dictionary. |
required |
parent_key |
str
|
The parent key. |
''
|
sep |
str
|
The separator to use for the flattened keys. |
'/'
|
Returns:
Type | Description |
---|---|
Dict
|
The flattened dictionary. |