optuna.storages.journal.JournalRedisBackend
- class optuna.storages.journal.JournalRedisBackend(url, use_cluster=False, prefix='')[source]
Redis storage class for Journal log backend.
- Parameters:
url (str) – URL of the redis storage, password and db are optional. (ie:
redis://localhost:6379
)use_cluster (bool) – Flag whether you use the Redis cluster. If this is
False
, it is assumed that you use the standalone Redis server and ensured that a write operation is atomic. This provides the consistency of the preserved logs. If this isTrue
, it is assumed that you use the Redis cluster and not ensured that a write operation is atomic. This means the preserved logs can be inconsistent due to network errors, and may cause errors.prefix (str) – Prefix of the preserved key of logs. This is useful when multiple users work on one Redis server.
Note
Added in v3.1.0 as an experimental feature. The interface may change in newer versions without prior notice. See https://github.com/optuna/optuna/releases/tag/v3.1.0.
Methods
append_logs
(logs)Append logs to the backend.
Load snapshot from the backend.
read_logs
(log_number_from)Read logs with a log number greater than or equal to
log_number_from
.save_snapshot
(snapshot)Save snapshot to the backend.