neuraxle.metaopt.repositories.repo

Module-level documentation for neuraxle.metaopt.repositories.repo. Here is an inheritance diagram, including dependencies to other base modules of Neuraxle:


Neuraxle’s Hyperparameter Repository Base Classes

Not all repositories can be found here, but the base can be found here.

See also

HyperparamsOnDiskRepository, DatabaseHyperparamRepository, SQLLiteHyperparamsRepository,

Functions

func_with_rlock()

Classes

HyperparamsRepository()

Hyperparams repository that saves hyperparams, and scores for every AutoML trial.

InMemoryHyperparamsRepository(*kargs, **kwargs)

In memory hyperparams repository that can print information about trials.

SynchronizedHyperparamsRepositoryWrapper(wrapped)

A wrapper that makes any HyperparamsRepository thread-safe using locking.

VanillaHyperparamsRepository(cache_folder)

Hyperparams repository that saves data AutoML-related info.


class neuraxle.metaopt.repositories.repo.HyperparamsRepository[source]

Bases: neuraxle.base.BaseService

Hyperparams repository that saves hyperparams, and scores for every AutoML trial. Cache folder can be changed to do different round numbers.

For more information, read this article by Martin Fowler on DDD Aggregates.

See also

AutoML, Trainer,

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

load(scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → SubDataclassT[source]

Get metadata from scope.

The fetched metadata will be the one that is the last item that is not a None in the provided scope.

Parameters

scope (ScopedLocation) – scope to get metadata from.

Returns

metadata from scope.

save(_dataclass: SubDataclassT, scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → neuraxle.metaopt.repositories.repo.HyperparamsRepository[source]

Save metadata to scope.

Parameters
  • metadata – metadata to save.

  • scope (ScopedLocation) – scope to save metadata to.

  • deep (bool) – if True, save metadata’s sublocations recursively.

add_logging_handler(logger: neuraxle.logging.logging.NeuraxleLogger, scope: neuraxle.metaopt.data.vanilla.ScopedLocation) → neuraxle.metaopt.repositories.repo.HyperparamsRepository[source]

Add logging handler to repository’s provided scope. Handler must be set manually for each scope below this scope.

Parameters
Returns

self.

get_log_from_logging_handler(logger: neuraxle.logging.logging.NeuraxleLogger, scope: neuraxle.metaopt.data.vanilla.ScopedLocation) → str[source]

Get log from repository’s provided scope and handler that was set with add_logging_handler().

Return type

str

Parameters

scope (ScopedLocation) – scope to get log from.

Returns

log from scope.

with_lock() → neuraxle.metaopt.repositories.repo.SynchronizedHyperparamsRepositoryWrapper[source]
_abc_impl = <_abc_data object>
neuraxle.metaopt.repositories.repo.func_with_rlock()[source]
class neuraxle.metaopt.repositories.repo.SynchronizedHyperparamsRepositoryWrapper(wrapped: neuraxle.metaopt.repositories.repo.HyperparamsRepository)[source]

Bases: neuraxle.base.MetaServiceMixin, neuraxle.metaopt.repositories.repo.HyperparamsRepository

A wrapper that makes any HyperparamsRepository thread-safe using locking.

__init__(wrapped: neuraxle.metaopt.repositories.repo.HyperparamsRepository)[source]

Initialize self. See help(type(self)) for accurate signature.

load(*args, **kwargs)[source]
save(*args, **kwargs)[source]
add_logging_handler(*args, **kwargs)[source]
get_log_from_logging_handler(*args, **kwargs)[source]
with_lock() → neuraxle.metaopt.repositories.repo.SynchronizedHyperparamsRepositoryWrapper[source]
_abc_impl = <_abc_data object>
class neuraxle.metaopt.repositories.repo._InMemoryRepositoryLoggerHandlerMixin[source]

Bases: object

Mixin to add a in-memory logging handler to a repository.

add_logging_handler(logger: neuraxle.logging.logging.NeuraxleLogger, scope: neuraxle.metaopt.data.vanilla.ScopedLocation) → neuraxle.metaopt.repositories.repo.HyperparamsRepository[source]
get_log_from_logging_handler(logger: neuraxle.logging.logging.NeuraxleLogger, scope: neuraxle.metaopt.data.vanilla.ScopedLocation) → str[source]
class neuraxle.metaopt.repositories.repo.VanillaHyperparamsRepository(cache_folder: str)[source]

Bases: neuraxle.metaopt.repositories.repo._InMemoryRepositoryLoggerHandlerMixin, neuraxle.metaopt.repositories.repo.HyperparamsRepository

Hyperparams repository that saves data AutoML-related info.

__init__(cache_folder: str)[source]
Parameters
  • cache_folder (str) – folder to store trials.

  • hyperparams_repo_class – class to use to save hyperparams.

  • hyperparams_repo_kwargs – kwargs to pass to hyperparams_repo_class.

static from_root(root: neuraxle.metaopt.data.vanilla.RootDataclass, cache_folder: str) → neuraxle.metaopt.repositories.repo.VanillaHyperparamsRepository[source]
load(scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → SubDataclassT[source]

Get metadata from scope.

The fetched metadata will be the one that is the last item that is not a None in the provided scope.

Parameters

scope (ScopedLocation) – scope to get metadata from.

Returns

metadata from scope.

save(_dataclass: SubDataclassT, scope: neuraxle.metaopt.data.vanilla.ScopedLocation, deep=False) → neuraxle.metaopt.repositories.repo.VanillaHyperparamsRepository[source]

Save metadata to scope.

Parameters
  • metadata – metadata to save.

  • scope (ScopedLocation) – scope to save metadata to.

  • deep (bool) – if True, save metadata’s sublocations recursively.

_abc_impl = <_abc_data object>
class neuraxle.metaopt.repositories.repo.InMemoryHyperparamsRepository(*kargs, **kwargs)[source]

Bases: neuraxle.logging.warnings.RaiseDeprecatedClass, neuraxle.metaopt.repositories.repo.VanillaHyperparamsRepository

In memory hyperparams repository that can print information about trials. Useful for debugging.

__init__(*kargs, **kwargs)[source]
Parameters
  • cache_folder – folder to store trials.

  • hyperparams_repo_class – class to use to save hyperparams.

  • hyperparams_repo_kwargs – kwargs to pass to hyperparams_repo_class.

_abc_impl = <_abc_data object>