Source code for glompo.generators.basegenerator

import logging
from abc import ABC, abstractmethod

import numpy as np

__all__ = ("BaseGenerator",)


[docs]class BaseGenerator(ABC): """ Base generator from which all generators must inherit to be compatible with GloMPO. Attributes ---------- logger : logging.Logger :class:`logging.Logger` instance into which status messages may be added. """ def __init__(self): self.logger = logging.getLogger('glompo.generator')
[docs] @abstractmethod def generate(self, manager: 'GloMPOManager') -> np.ndarray: """ Returns a vector representing a location in input space. The returned array serves as a starting point for an optimizer. Parameters ---------- manager :class:`.GloMPOManager` instance which is managing the optimization. Its attributes can be accessed when determining the convergence criteria. """