optuna.storages

The storages module defines a BaseStorage class which abstracts a backend database and provides library-internal interfaces to the read/write histories of the studies and trials. Library users who wish to use storage solutions other than the default in-memory storage should use one of the child classes of BaseStorage documented below.

optuna.storages.RDBStorage

Storage class for RDB backend.

optuna.storages.RetryFailedTrialCallback

Retry a failed trial up to a maximum number of times.

optuna.storages.fail_stale_trials

Fail stale trials and run their failure callbacks.

optuna.storages.JournalStorage

Storage class for Journal storage backend.

optuna.storages.journal

JournalStorage requires its backend specification and here is the list of the supported backends:

Note

If users would like to use any backends not supported by Optuna, it is possible to do so by creating a customized class by inheriting optuna.storages.journal.BaseJournalBackend.

optuna.storages.journal.JournalFileBackend

File storage class for Journal log backend.

optuna.storages.journal.JournalRedisBackend

Redis storage class for Journal log backend.

Users can flexibly choose a lock object for JournalFileBackend and here is the list of supported lock objects:

optuna.storages.journal.JournalFileSymlinkLock

Lock class for synchronizing processes for NFSv2 or later.

optuna.storages.journal.JournalFileOpenLock

Lock class for synchronizing processes for NFSv3 or later.

Deprecated Modules

Note

The following modules are deprecated at v4.0.0 and will be removed in the future. Please use the modules defined in optuna.storages.journal.

optuna.storages.BaseJournalLogStorage

Base class for Journal storages.

optuna.storages.JournalFileStorage

optuna.storages.JournalRedisStorage