update_meta()¶
- audmodel.update_meta(uid, meta, *, replace=False, cache_root=None, verbose=False)[source]¶
Update metadata of model on backend and in cache.
Unless
replace
is set toTrue
iterates through current meta dictionary and updates fields where they match or adds missing fields, but keeps all existing fields.- Parameters
- Return type
- Returns
new meta dictionary
- Raises
audbackend.BackendError – if connection to repository on backend cannot be established
RuntimeError – if model does not exist
RuntimeError – if
meta
cannot be serialized to a YAML file
Examples
>>> meta = { ... "model": { ... "cnn10": {"layers": 10}, ... }, ... } >>> d = update_meta("d4e9c65b-3.0.0", meta) >>> print(yaml.dump(d)) data: emodb: version: 1.2.0 feature: melspec: win_dur: 32ms hop_dur: 10ms num_fft: 512 mel_bins: 64 model: cnn10: learning-rate: 0.01 optimizer: adam layers: 10 >>> d = update_meta("d4e9c65b-3.0.0", meta, replace=True) >>> print(yaml.dump(d)) model: cnn10: layers: 10