Skip to content

Commit

Permalink
Merge pull request #159 from CyberAgentAILab/feature-get-mean
Browse files Browse the repository at this point in the history
get mean
  • Loading branch information
nomuramasahir0 authored Dec 27, 2023
2 parents 07d26c9 + 22b4763 commit 057798d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmaes/_cma.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ def generation(self) -> int:
when multi-variate gaussian distribution is updated."""
return self._g

@property
def mean(self) -> np.ndarray:
"""Mean Vector"""
return self._mean

def reseed_rng(self, seed: int) -> None:
self._rng.seed(seed)

Expand Down
5 changes: 5 additions & 0 deletions cmaes/_cmawm.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ def generation(self) -> int:
when multi-variate gaussian distribution is updated."""
return self._cma.generation

@property
def mean(self) -> np.ndarray:
"""Mean Vector"""
return self._cma.mean

@property
def _rng(self) -> np.random.RandomState:
return self._cma._rng
Expand Down
5 changes: 5 additions & 0 deletions cmaes/_sepcma.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def generation(self) -> int:
when multi-variate gaussian distribution is updated."""
return self._g

@property
def mean(self) -> np.ndarray:
"""Mean Vector"""
return self._mean

def reseed_rng(self, seed: int) -> None:
self._rng.seed(seed)

Expand Down

0 comments on commit 057798d

Please sign in to comment.